创建一个Score类,完成以下功能:
1)连续输入多位学生的float成绩(成绩=科目A成绩+科目B成绩+科目C成绩);
2)学生数目可以由用户自定义(默认为2个,最多为100个。提示:使用变量。);
3)显示每位同学的每科成绩和平均分;
4)显示每门科目的平均成绩;
5)对每门成绩进行排序并由高到低显示;
#include<iostream>
#include<string>
using namespace std;
class studentsscore {
public:
studentsscore()
{
students_nr = 2;
}
studentsscore(int students_count)
{
students_nr = students_count;
}
~studentsscore()
{
cout << "Press any key to continue" << endl;
}
void input_students_name_and_score()
{
for (int students_id=0; students_id < students_nr; students_id++)
{
cout << "请输入学生姓名:";
cin >> name[students_id];
cout << "请输入科目a成绩:";
cin >> score[students_id][0];
cout << "请输入科目b成绩