一:题目
二:思路分析
这道题就是会使用C语言的结构体,然后知道结构体数组
三:代码
#include <stdio.h>
struct Stu
{char name[10];int c;int m;int e;
}s[1005];//结构体数组
int main()
{int n = 0;scanf("%d", &n);int max = 0;int i = 0;int m = n;/*for(i =0; i<n; i++){int sum = 0;scanf("%s %d %d %d", s[i].name, &s[i].c, &s[i].m, &s[i].e);sum = s[i].c + s[i].e + s[i].m;if (sum > max)max = sum;}*/while (n--){int sum = 0;scanf("%s %d %d %d", s[i].name, &s[i].c, &s[i].m, &s[i].e);sum = s[i].c + s[i].e + s[i].m;if (sum > max)max = sum;i++;}for (i = 0; i < m; i++){if (s[i].c + s[i].e + s[i].m == max){printf("%s %d %d %d", s[i].name, s[i].c, s[i].m, s[i].e);break;}}return 0;
}