#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二级辅导-进制转换 (C语言代码)浏览:649 |
A+B for Input-Output Practice (II) (C语言代码)浏览:1035 |
C语言程序设计教程(第三版)课后习题6.10 (C语言代码)浏览:1083 |
C语言训练-大、小写问题 (C语言代码)浏览:641 |
C语言程序设计教程(第三版)课后习题7.1 (C语言代码)浏览:639 |
C语言程序设计教程(第三版)课后习题1.6 (C语言代码)浏览:569 |
Cylinder (C语言描述+详细分析)浏览:3338 |
C语言程序设计教程(第三版)课后习题3.7 (C语言代码)浏览:557 |
简单的a+b (C语言代码)浏览:570 |
1118(求助_已解决)浏览:349 |