Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
67392 | 冯诚阳 | 朋友信息 | C++ | Accepted | 1 MS | 268 KB | 609 | 2024-03-16 14:50:17 |
#include<algorithm> #include<iostream> #include<cstring> #include<cmath> #include<iomanip> using namespace std; struct fd{ string name; int b; string phone; }c[20]; bool cmp(fd x,fd y){ if(x.b!=y.b) return x.b<y.b; else if(x.name!=y.name) return x.name<y.name; else return x.phone<y.phone; } int main(){ int n; cin>>n; for(int i=0;i<n;i++){ cin>>c[i].name>>c[i].b>>c[i].phone; } sort(c+0,c+n,cmp); for(int i=0;i<n;i++){ cout<<c[i].name<<" "<<c[i].b<<" "<<c[i].phone<<endl; } return 0; }