#include <stdio.h>
typedef struct student
{
char ID[30];
char Name[30];
int a, b, c;
} STU;
int main()
{
STU stu, max;
int n;
scanf("%d", &n);
max.a = max.b = max.c = 0;
while (n--)
{
scanf("%s %s %d %d %d", stu.ID, stu.Name, &stu.a, &stu.b, &stu.c);
if (stu.a + stu.b + stu.c > max.a + max.b + max.c)
{
max = stu;
/* code */
}
/* code */
}
printf("%s %s %d %d %d\n", max.ID, max.Name, max.a, max.b, max.c);
return 0;
}
成绩统计(结构体专题)
最新推荐文章于 2022-09-29 22:00:28 发布