| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 157473 | 陈骏睿 | 成绩排序 | C++ | Accepted | 1 MS | 284 KB | 730 | 2026-07-24 11:09:29 |
#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 cj{ char a[21]={}; int x; }; int main(){ int n; cj b[21]={}; cin>>n; for(int i=0;i<n;i++)cin>>b[i].a>>b[i].x; for(int i=0;i<n-1;i++){ for(int j=0;j<n-i-1;j++){ if(b[j].x<b[j+1].x)swap(b[j],b[j+1]); else if(b[j].x==b[j+1].x){ int d=strcmp(b[j].a,b[j+1].a); if(d>0)swap(b[j],b[j+1]); } } } for(int i=0;i<n;i++){ cout<<b[i].a<<" "<<b[i].x<<endl; } return 0; }