0
已解决
范浩轩
资深守护
资深守护
#include<iostream>
#include<algorithm>
using namespace std;
struct stu{
string s;
int x,y;
int sum()
{
return x+=500*y;
}
}a[105];
bool cmp(stu x,stu y)
{
if(x.sum()!=y.sum())
{
return x.sum()>y.sum();
}
return x.s<y.s;
}
int main()
{
int n;
cin>>n;
for(int i=1;i<=n;i++)
{
cin>>a[i].s>>a[i].x>>a[i].y;
}
sort(a+1,a+n+1,cmp);
for(int i=1;i<=n;i++)
{
cout<<a[i].s<<" "<<a[i].sum()<<endl;
}
return 0;
}
快点回答!!!
范浩轩在2023-02-26 19:30:59追加了内容
没人会???
范浩轩在2023-02-26 19:31:39追加了内容
这么高分值怎么都没人回???!!!???