Eva_91418 @ 2023-08-01 21:53:56
#include<bits/stdc++.h>
using namespace std;
struct stu
{
string s;
int yu,shu,ying,z,num;
};
stu a[1010];
int cmp(stu a,stu b)
{
return a.z>b.z||a.z==b.z&&a.num<b.num;
}
int main()
{
int n;
cin>>n;
for(int i=0;i<n;i++)
{
cin>>a[i].s;
cin>>a[i].yu>>a[i].shu>>a[i].ying;
a[i].num=i;
}
sort(a,a+n,cmp);
cout<<a[0].s<<' '<<a[0].yu<<' '<<a[0].shu<<' '<<a[0].ying;
return 0;
}
by ybc2025chenyuyang @ 2023-08-01 21:59:15
你的a[i].z赋值了吗
by ybc2025chenyuyang @ 2023-08-01 22:00:00
能骗到20分证明你谷数据太水了
by Eva_91418 @ 2023-08-01 22:57:49
@ybc2025125chenyuyang 我才发现哈哈哈(不过这个数据确实有点水)