| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 133372 | 欧阳俊懿 | 朋友信息 | C++ | Compile Error | 0 MS | 0 KB | 850 | 2025-10-18 16:16:07 |
#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; struct fd{ string name; int birth; string number; }f[20]; bool cmp(fd x,fd y){ if(x.birth!=y.birth){ return x.birth<y.birth; } else if(x.name!=y.name){ return x.name<y.name; } else{ return x.number<y.number; } } int main(){ int n; cin>>n; for(int i=0;i<n;i++){ cin>>f[i].name>>f[i].birth>>f[i].number; } sort(f+0,f+n,cmp); for(int i=0;i<n;i++){ cout<<f[i].name<<" "<<f[i].birth<<" "<<f[i].number<<endl; } return 0; }
Main.cc: In function 'int main()':
Main.cc:29:21: error: 'sort' was not declared in this scope
sort(f+0,f+n,cmp);
^