#3WA求助
查看原帖
#3WA求助
486727
IaLWH楼主2021/9/25 15:22

只有#3 WA了,求dalao康康

#include<cstdio>
#include<vector>
using namespace std;
struct stu{
	char n[8];
	short c,m,e;
	short t;
};

int main(){
	vector<stu>v;
	stu h;
	short n;
	scanf("%hd",&n);
	for(short i=0;i<n;i++){
		scanf("%s%hd%hd%hd",h.n,&h.c,&h.m,&h.e);
		h.t=h.c+h.m+h.e;
		v.push_back(h);
	}
	h=*v.begin();
	for(short i=1;i<n;i++)
		if(v[i].t>h.t)h=v[i];
	printf("%s %hd %hd %hd",h.n,h.c,h.m,h.e);
	return 0;
} 

dalao Orz

2021/9/25 15:22
加载中...