提交时间:2024-05-22 13:16:20
运行 ID: 148147
#include<bits/stdc++.h> using namespace std;int i,j;double t=0; struct student{ int num; string name; int a,b,c; float all; }; student q[20]; int main() { for(i=1;i<=10;i++){ cin>>q[i].num>>q[i].name>>q[i].a>>q[i].b>>q[i].c; t=t+q[i].a+q[i].b+q[i].c; q[i].all=q[i].a+q[i].b+q[i].c; } for(i=1;i<=10;i++){ for(j=1;j<=10;j++){ if(q[j].all<q[j+1].all) swap(q[j],q[j+1]); } } printf("%.2f\n",t/30); cout<<q[1].num<<" "<<q[1].name<<" "; printf("%.2f",q[1].all/3); return 0; }