Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
100 | 张宸瑞 | 朋友信息 | C++ | Wrong Answer | 0 MS | 256 KB | 847 | 2022-07-19 10:17:26 |
#include <iostream> #include <cstring> #include <cstdio> #include <algorithm> using namespace std; struct stu{ string name; int birthday; string phone_number; }a[11]; bool cmp(stu x,stu y){ if(x.birthday>y.birthday){ return x.birthday<y.birthday; } else if(x.birthday==y.birthday){ if(x.name<y.name){ return x.birthday<y.birthday; } else if(x.phone_number<y.phone_number){ return x.birthday<y.birthday; } } } int main() { int n; cin>>n; for(int i=0;i<n;i++){ getline(cin,a[i].name); cin>>a[i].birthday; getline(cin,a[i].name); } sort(a,a+n,cmp); for(int i=0;i<n;i++){ cout<<a[i].name<<" "<<a[i].birthday<<" "<<a[i].phone_number<<endl; } return 0; }
------Input------
4 lele 19990302 13685930581 lema 19990302 13592039485 Kity 20010912 1872749501 Joy 19990302 18792049590
------Answer-----
Joy 19990302 18792049590 lele 19990302 13685930581 lema 19990302 13592039485 Kity 20010912 1872749501
------Your output-----
0 0 0 0