#include #include #include #include void input(); void order(); void output(); int sum=2; int flag; struct stu { int Id; int clas; float score1; float score2; float score3; float score; }stu[100]={{1001,11,99.5,88.5,89.5,277.5}, {1002,12,77.9,56.5,87.5,221.9}, {1003,11,92.5,99.0,60.5,252}}; int main() { while(1) { input(); order(); output(); } } void input() { sum=sum+1; scanf("%d",&stu[sum].Id); flag=stu[sum].Id; scanf("%d",&stu[sum].clas); scanf("%f",&stu[sum].score1); scanf("%f",&stu[sum].score2); scanf("%f",&stu[sum].score3); stu[sum].score=stu[sum].score3+stu[sum].score2+stu[sum].score1; } void order() { for(int i=0;i<=sum;i++) { for(int j=i;j<=sum;j++) { if(stu[i].clas>stu[j].clas) { stu[sum+1]=stu[i]; stu[i]=stu[j]; stu[j]=stu[sum+1]; } else if(stu[i].clas==stu[j].clas) { if(stu[i].score