?? p312 9.7.cpp
字號:
#include<iostream>
using namespace std;
class Student
{
public:
Student(int n,float s):num(n),score(s){}
void change(int n,float s)const { num=n; score=s; }
void display()const {cout<<num<<" "<<score<<endl;}
private:
mutable int num;
mutable float score;
};
int main()
{
const Student stud(101,78.5);
stud.display();
stud.change(101,80.4);
stud.display();
system("pause");
return 0;
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -