Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
41313 Songgy_King 成绩排序 C++ 解答错误 1 MS 256 KB 417 2024-02-20 11:46:34

Tests(0/1):


#include<bits/stdc++.h> using namespace std; struct stu{ string name; int fs; }; bool cmp(stu a,stu b){ if(a.fs>b.fs){ return a.fs>b.fs; }else{ return a.name>b.name; } } int main() { stu stud[30]; int n; cin>>n; for(int i=0;i<n;i++){ cin>>stud[i].name>>stud[i].fs; } sort(stud,stud+n,cmp); for(int i=0;i<n;i++){ cout<<stud[i].name<<" "<<stud[i].fs<<endl; } return 0; }


测评信息: