几乎全wa,大佬们救一下QAQ
查看原帖
几乎全wa,大佬们救一下QAQ
1084866
dead000楼主2023/11/1 15:06

#include<stdio.h>
struct student{
	char name[9];
	int score[4];
};
int main()
{
	int n;
	scanf("%d",&n);
	int sum[1001];
	struct student stu[1001];
	for(int i=0;i<n;i++){
		scanf("%s",&stu[i].name);
		for(int j=0;j<3;j++){
			scanf("%d",&stu[i].score[j]);
			sum[i]+=stu[i].score[j];
		}
	}
	int max=-99,t;
	for(int i=0;i<n;i++){
		if(sum[i]>max){
			max=sum[i];
			t=i;
		}
	}
	printf("%s %d %d %d",stu[t].name,stu[t].score[0],stu[t].score[1],stu[t].score[2]);	
 } 
2023/11/1 15:06
加载中...