tjx1127 @ 2023-02-07 15:36:38
第八个点RE
#include<stdio.h>
int n,x,max,sum[500];
struct stu
{
char name[9];
int chinese,math,english;
};
int main()
{
scanf("%d",&n);
struct stu a[1000];
for(int i=0;i<n;i++)
{
scanf("%s %d %d %d",&a[i].name,&a[i].chinese,&a[i].math,&a[i].english);
sum[i]=a[i].chinese+a[i].math+a[i].english;
if(max<sum[i]){max=sum[i];x=i;}
}
printf("%s %d %d %d ",a[x].name,a[x].chinese,a[x].math,a[x].english);
return 0;
}
致谢!
by ud2_ @ 2023-02-07 15:40:24
N ≤ 1000,但 sum
是 int[500]
。
by tjx1127 @ 2023-02-07 16:21:15
@ud2_ AC了,谢谢orz!