#include <iostream>
using namespace std;
//设计一个学生类
class CStudent
{
public: //公有成员
void InputData()
{
cout << "请输入学号";
cin >> sno;
cout << "请输入姓名";
cin >> sname;
cout << "请输入分数";
cin >> dscore;
}
void OutputData();
double deverage;
private: //私有成员
int sno;//学号
char sname[10];//姓名
double dscore; //分数
protected:
};
inline void CStudent::OutputData()
{
cout << "\n学生的数据信息如下:" << endl;
cout << "学号:" << sno << endl;
cout << "姓名:" << sname << endl;
cout << "分数:" << dscore << endl;
}
int count_func()
{
//static int x = 0;
int x = 0;
return ++x;
}
int main()
{
CStudent stu1;
stu1.InputData();
stu1.OutputData();
for (int i = 0; i < 5; i++)
cout <<"调用计数函数:"<< count_func() << endl;
}