#include <stdio.h>
int intput(struct Student *p,int len);
int age(struct Student *p);
int compare(struct Student *p,int len);
struct Student
{
char name[10];
int number;
int a,b,c;
};
int main()
{
int n;
struct Student s[10];
scanf("%d",&n);
intput(s,n);
age(s,n);
compare(s,n);
return 0;
}
int intput(struct Student * p,int len)
{
int i;
for(i=0;i<len;i++)
{
scanf("%s%d%d%d%d",(p+i)->name,&(p+i)->number,&(p+i)->a,&(p+i)->b,&(p+i)->c);
}
}
int age(struct Student * p,int len)
{
int sa=0,sb=0,sc=0,i;
for(i=0;i<len;i++)
{
sa+=p[i].a;
sb+=p[i].b;
sc+=p[i].c;
}
sa/=len;
sb/=len;
sc/=len;
printf("%d %d %d\n",sa,sb,sc);
}
int compare(struct Student *p,int len)
{
int f[10];
int i;
for(i=0;i<len;i++)
{
f[i]=p[i].a+p[i].b+p[i].c;
}
if(f[i]>f[i+1])
{
i=0;
printf("%s %d %d %d %d\n",p[i].name,p[i].number,p[i].a,p[i].b,p[i].c);
}else
{
i=1;
printf("%s %d %d %d %d\n",p[i].name,p[i].number,p[i].a,p[i].b,p[i].c);
}
}
0.0分
0 人评分