80WA,玄关
  • 板块P1104 生日
  • 楼主LNYZY
  • 当前回复6
  • 已保存回复6
  • 发布时间2024/10/24 21:13
  • 上次更新2024/10/24 22:03:30
查看原帖
80WA,玄关
1278494
LNYZY楼主2024/10/24 21:13

80分链接

#include<bits/stdc++.h>
using namespace std;
struct t{
	int y,m,d,lj;
	string student_name;
}a[105];
bool cmp(t a,t b){
	if(a.y!=b.y){
		return a.y<b.y;
	}
	else{
		if(a.m!=b.m){
			return a.m<b.m;
		}
		else if(a.d==b.d and a.m==b.m){
			return a.lj>b.lj;
		}
		else{
			return a.d<b.d;
		}
	}
}
int main(){
	int n;
	cin>>n;
	for(int i=1;i<=n;i++){
		cin>>a[i].student_name>>a[i].y>>a[i].m>>a[i].d;
	}
	sort(a+1,a+n+1,cmp);
	for(int i=1;i<=n;i++){
		cout<<a[i].student_name<<endl;
	}
    return 0;
}
2024/10/24 21:13
加载中...