__F__ @ 2024-07-13 08:03:15
#include<bits/stdc++.h>
using namespace std;
struct x{
string xm;
int y,m,d;
}a[10000];
int main(){
int n;
cin>>n;
for(int i=1;i<=n;i++){
cin>>a[i].xm;
cin>>a[i].y>>a[i].m>>a[i].d;
}
for(int i=1;i<=n;i++){
for(int j=1;j<=n;j++){
if(a[j].y>a[j+1].y){
swap(a[j].y,a[j+1].y);
swap(a[j].m,a[j+1].m);
swap(a[j].d,a[j+1].d);
swap(a[j].xm,a[j+1].xm);
}else if(a[j].y==a[j+1].y){
if(a[j].m>a[j+1].m){
swap(a[j].m,a[j+1].m);
swap(a[j].d,a[j+1].d);
swap(a[j].xm,a[j+1].xm);
}else if(a[j].m==a[j+1].m){
if(a[j].d>=a[j+1].d){
swap(a[j].d,a[j+1].d);
swap(a[j].xm,a[j+1].xm);
}
}
}
}
}
for(int i=2;i<=n+2;i++){
cout<<a[i].xm<<endl;
}
return 0;
}
by _joker_r @ 2024-07-13 08:43:12
by _joker_r @ 2024-07-13 09:04:42
我建议你像我一样在结构体内再加一个变量用来存储输入顺序@yuhan09
by zhizhenhuyuzhe @ 2024-07-13 10:28:11
对不起于涵,我知道错了
请你别发了,谢谢
by zhizhenhuyuzhe @ 2024-07-13 10:30:14
@yuhan09快会关我,回宿舍肘你去