P1104代码求条
  • 板块灌水区
  • 楼主WoshiMengXin_
  • 当前回复1
  • 已保存回复1
  • 发布时间2024/10/20 12:52
  • 上次更新2024/10/20 13:05:01
查看原帖
P1104代码求条
1409879
WoshiMengXin_楼主2024/10/20 12:52

rt

#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
}

求问函数哪出问题了

2024/10/20 12:52
加载中...