求助,无输出
查看原帖
求助,无输出
719208
ResonCaolol楼主2023/5/21 13:49
#include<bits/stdc++.h>
using namespace std;
int sum[1001];
int maxx;
struct student{
	string name;
	int eng;
	int chi;
	int mat;
}q[1001]; 
int main()
{
	int n;
	cin>>n;
	for(int i=0;i<n;i++)
	{
		cin>>q[i].name>>q[i].chi>>q[i].mat>>q[i].eng;
		sum[i]=q[i].chi+q[i].eng+q[i].mat;
		max(maxx,sum[i]);
	}
	for(int i=0;i>n;i++)
	{
		if(sum[i]==maxx) cout<<q[i].name<<q[i].chi<<q[i].mat<<q[i].eng;
	}
	return 0;
}
2023/5/21 13:49
加载中...