Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
118140 | 万隽宇 | 朋友信息 | C++ | Accepted | 1 MS | 272 KB | 739 | 2025-04-24 19:04:03 |
#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 bo{ string m; int s; string d; }b[20]; bool c(bo x,bo y){ if(x.s!=y.s){ return x.s<y.s; } else if(x.m!=y.m){ return x.m<y.m; } else{ return x.d<y.d; } } int main(){ int n; cin>>n; for(int i=0;i<n;i++){ cin>>b[i].m>>b[i].s>>b[i].d; } sort(b+0,b+n,c); for(int i=0;i<n;i++){ cout<<b[i].m<<' '<<b[i].s<<' '<<b[i].d<<endl; } return 0; }