| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 157480 | 任艺宸 | 朋友信息 | C++ | Wrong Answer | 1 MS | 264 KB | 733 | 2026-07-24 12:59:21 |
#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<algorithm> #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; struct my{ string m; string s; string d; }a[11]; bool cmp(my x,my y) { if(x.s!=y.s){ return x.s<y.s; } if(x.m!=y.m){ return x.m<y.m; } return x.d<x.d; } int main(){ int n; cin>>n; for(int i=0;i<n;i++){ cin>>a[i].m>>a[i].s>>a[i].d; } sort(a,a+n,cmp); for(int i=0;i<n;i++){ cout<<a[i].m<<" "<<a[i].s<<" "<<a[i].d<<endl; } return 0; }
------Input------
6 lele 19990302 13685930581 lema 19990302 13592039485 Kity 20010912 1872749501 Joy 19990302 18792049590 Hello 20050912 13685930580 Hello 20050912 13685930579
------Answer-----
Joy 19990302 18792049590 lele 19990302 13685930581 lema 19990302 13592039485 Kity 20010912 1872749501 Hello 20050912 13685930579 Hello 20050912 13685930580
------Your output-----
Joy 19990302 18792049590 lele 19990302 13685930581 lema 19990302 13592039485 Kity 20010912 1872749501 Hello 20050912 13685930580 Hello 20050912 13685930579