shiti5_5_2.cpp

来自「为初学者提供的最佳的C++程序设计源程序库」· C++ 代码 · 共 29 行

CPP
29
字号
class Student
{
public:
	Student(){ComputerScore=0;}
	Student(float Score)
	{
		ComputerScore=Score;
		totalScore+=Score;
		Count++;
	}
	static float TotalSum()
	{
		return totalScore;
	}
	static float Average()
	{
		return totalScore/Count;
	}
private:
	float ComputerScore;
	static float totalScore;
	static float averageScore;
	static int Count;
};
float Student::totalScore=0;
float Student::averageScore=0;
int Student::Count=0;

⌨️ 快捷键说明

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