早教吧 育儿知识 作业答案 考试题库 百科 知识分享

求如下程序函数和算法思想#includeusingnamespacestd;classStudent{private:doublescore;public:staticdoubletotal;staticintcount;voidScoreTotalCount(doubles){score=s;total=total+s;count=count+1;}staticdoublesum(){r

题目详情
求如下程序函数和算法思想#include using namespace std; class Student { private: double score; public: static double total; static int count; void ScoreTotalCount(double s) { score=s; total=total+s; count=count+1; } static double sum() { return total; } static double average() { return total/count; } }; int Student::count=0; double Student::total=0; /*int main() { Student s1,s2,s3,s4,s5; s1.ScoreTotalCount(91); s2.ScoreTotalCount(92); s3.ScoreTotalCount(93); s4.ScoreTotalCount(94); s5.ScoreTotalCount(95); cout
▼优质解答
答案和解析
统计成绩,求总分和平均分