Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
150408 李朋秦 朋友信息 C++ Accepted 1 MS 268 KB 446 2026-03-28 09:07:39

Tests(3/3):


Code:

#include<bits/stdc++.h> using namespace std; struct f{ string m; long long s; long long d; }a[11]; bool sum(f x,f 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>>a[i].m>>a[i].s>>a[i].d; } sort(a+0,a+n,sum); for(int i=0;i<n;i++){ cout<<a[i].m<<" "<<a[i].s<<" "<<a[i].d<<endl; } return 0; }