#include <stdio.h>
struct stu
{
char name[50], num[50];
int a, b, c;
};
void input(struct stu *p)
{
scanf("%s %s %d %d %d",p->num, p->name, &p->a, &p->b, &p->c);
}
int main()
{
struct stu stu1[100], *p;
int N, sum1,sum2,sum3, i,j, max;
sum1 = 0;
sum2 = 0;
sum3 = 0;
max = 0;
scanf("%d", &N);
for (p = stu1; p < stu1+N ; p++)
{
input(p);
}
for (i = 0; i < N ; i++)
{
sum1 += stu1[i].a;
sum2 += stu1[i].b;
sum3 += stu1[i].c;
if (stu1[i].a+stu1[i].b+stu1[i].c > max)
{
max = stu1[i].a+stu1[i].b+stu1[i].c;
j = i;
}
}
printf("%d %d %d\n", sum1/N, sum2/N, sum3/N);
printf("%s %s %d %d %d\n",stu1[j].num, stu1[j].name, stu1[j].a, stu1[j].b, stu1[j].c);
return 0;
}
0.0分
2 人评分
C语言训练-计算t=1+1/2+1/3+...+1/n (C语言代码)浏览:539 |
C语言程序设计教程(第三版)课后习题7.3 (C语言代码)浏览:643 |
不容易系列2 (C语言代码)浏览:640 |
2003年秋浙江省计算机等级考试二级C 编程题(2) (C语言代码)浏览:690 |
printf基础练习2 (C语言代码)浏览:653 |
P1000 (C语言代码)浏览:911 |
字符逆序 (C语言代码)浏览:505 |
永远的丰碑 (C语言代码)浏览:608 |
C语言程序设计教程(第三版)课后习题1.5 (C语言代码)浏览:497 |
汽水瓶 (C语言代码)浏览:579 |