源码简介: |
定义一个CStudent类,在该类定义中包括:一个数据成员score(分数)及两个静态数据成员total(总分)和学生人数count:成员函数STC(float s)设置分数,求总分,累计学生人数:静态成员函数Sum返回总分;静态成员函数Average求平均值。在main函数中,输入某班同学的成绩,并调用上述函数求全班学生的总分和平均分。-Define a CStudent class in the class definition, including: a data member score (Score) and two static data members total (total score) and the number of students count: the member function STC (float s) set score, find the total score, the cumulative Number of students: the static member function Sum return score static member function Average average. In the main function, enter the results of a class of students seeking the total score and the average score of students in the class and call the above function.
|