社区讨论
P1104代码求条
灌水区参与者 1已保存回复 1
讨论操作
快速查看讨论及其快照的属性,并进行相关操作。
- 当前回复
- 1 条
- 当前快照
- 1 份
- 快照标识符
- @m2h46kyj
- 此快照首次捕获于
- 2024/10/20 12:55 去年
- 此快照最后确认于
- 2024/10/20 13:05 去年
rt
CPP#define I return
#define AK 0
#define IOI ;
#include "bits/stdc++.h"
using namespace std;
struct x{
string a;
int b,c,d;
}e[101];
bool cmp(x m,x n){
if(m.b>n.b){
return 1;
}else{
if(m.b<n.b){
return 0;
}else{
if(m.c>n.c){
return 1;
}else{
if(m.c<n.c){
return 0;
}else{
if(m.d>n.d){
return 1;
}else{
return 0;
}
}
}
}
}
}
int main(){
int n;
cin>>n;
for(int i=1;i<=n;i++)cin>>i[e].a>>i[e].b>>i[e].c>>i[e].d;
sort(e+1,e+n+1,cmp);
for(int i=n;i>=1;i--)cout<<i[e].a<<endl;
I AK IOI
}
求问函数哪出问题了
回复
共 1 条回复,欢迎继续交流。
正在加载回复...