奥特曼身高问题 题解
2025-05-07 17:25:56
发布于:北京
0阅读
0回复
0点赞
#include<bits/stdc++.h>
using namespace std;
struct atm{
string name;
double height;
int year;
}peo[105];
bool cmp(atm x,atm y){
if (x.height!=y.height) return x.height>y.height;
return x.year<y.year;
}
int main()
{
int n;
cin>>n;
for (int i=1;i<=n;i++) cin>>peo[i].name>>peo[i].height>>peo[i].year;
sort(peo+1,peo+n+1,cmp);
cout<<peo[1].name<<' '<<peo[1].height<<' '<<peo[1].year;
return 0;
}
这里空空如也
有帮助,赞一个