Ycy951130 @ 2024-07-17 18:55:03
#include<bits/stdc++.h>
using namespace std;
int a,b,c,n,max_a,max_b,max_c;
int main()
{
string mz,m;
int max=0;
cin>>n;
for(int i=1;i<=n;i++)
{
cin>>mz>>a>>b>>c;
if(a+b+c>max)
{
max_a=a;
max_b=b;
max_c=c;
max=a+b+c;
m=mz;
}
}
cout<<m<<' '<<max_a<<' '<<max_b<<' '<<max_c;
}
求助
by luogu_starblue @ 2024-07-17 18:58:05
@Ycy951130 分数可能全为0
by Ycy951130 @ 2024-07-17 19:08:44
谢谢@luogu_starblue 已AC 此贴结