#include<stdio.h>
struct st
{ char xuehao[20];
char name[20];
int a1;
int a2;
int a3;
};
int main()
{ int q,N;
struct st studen[100];
void work(struct st student[],int n);
void work1(struct st student[],int n);
scanf("%d",&N);
fflush(stdin);
for(q=0;q<N;q++)
{ scanf("%s %s %d %d %d",&studen[q].xuehao,&studen[q].name,&studen[q].a1,&studen[q].a2,&studen[q].a3);
}
work(studen,N);
work1(studen,N);
}
void work(struct st student[],int n)
{ int i,w=0,e=0,r=0;
for(i=0;i<n;i++)
{ w=w+student[i].a1;
e=e+student[i].a2;
r=r+student[i].a3;
}
w=w/n;
e=e/n;
r=r/n;
printf("%d %d %d\n",w,e,r);
}
void work1(struct st student[],int n)
{ int t,y=0,u=0,j;
for(j=0;j<n;j++)
{ u=student[j].a1+student[j].a2+student[j].a3;
if(u>y)
{ t=j;
y=u;
}
}
printf("%s %s %d %d %d",student[t].xuehao,student[t].name,student[t].a1,student[t].a2,student[t].a3);
}
0.0分
1 人评分