⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 xt9-7-2.cpp

📁 最新版谭浩强《c++语言程序设计》所有习题的原代码
💻 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.5);
 stud.display();
 return 0;
}
 


   

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -