#include<iostream>
using namespace std;
typedef struct student {
char name[10];
int ID;
int age;
float score[3];
float sum;
}student;
int main()
{
int i, j;
student stu[10];
cout << "输入十个学生信息:" << endl;
for (i = 0; i<10; i++)
{
cin >> stu[i].name >> stu[i].ID >> stu[i].age;
cin >> stu[i].score[0] >> stu[i].score[1] >> stu[i].score[2];
}
for (i = 0; i<10; i++)
{
stu[i].sum = stu[i].score[0] + stu[i].score[1] + stu[i].score[2];
}
student temp;
for (i = 0; i<10 - 1; i++)
for (j = 0; j<10 - 1 - i; j++)
{
if (stu[j].sum<stu[j + 1].sum)
{
temp = stu[j];
stu[j] = stu[j + 1];
stu[j + 1] = temp;
}
}
for (i = 0; i<10; i++)
{
cout << stu[i].name << "," << stu[i].ID << "," << stu[i].sum << endl;
}
return 0;
}