0
已解决
张云瀚
初级天翼
初级天翼
题目链接: 酷町堂:1332
#include<iostream>
#include<algorithm>
#include<string>
using namespace std;
int n;
struct node{
string s;
int y,m,d;
int id;
}a[10005];
bool cmp(node x,node y){
if(x.y!=y.y){
return x.y<y.y;
}
else if(x.m!=y.m){
return x.m<y.m;
}
else if(x.d!=y.d){
return x.d<y.d;
}
return x.id<y.id;
}
int main(){
cin>>n;
for(int i=1;i<=n;i++){
cin>>a[i].s>>a[i].y>>a[i].m>>a[i].d;
a[i].id=i;
}
sort(a+1,a+n+1,cmp);
for(int i=1;i<=n;i++){
cout<<a[i].s<<endl;
}
return 0;
}