Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
79514 常仕铎 成绩排序 C++ Runtime Error 0 MS 272 KB 614 2024-07-07 11:38:05

Tests(0/10):


Code:

#include<cstring> #include<iostream> #include<algorithm> using namespace std; struct grades{ char name[22]; int score; } a[22]; int main(){ int n; cin>>n; for(int i=0;i<n;i++) cin>>a[i].name>>a[i].score; for(int i=0;i<n-1;i++){ for(int j=0;j<n-i-1;j++){ if(a[j].score<a[j+1].score) swap(a[j],a[j+1]); if(a[j].score==a[j+1].score){ if(strcmp(a[j+1].name,a[j].name)==-1) swap(a[j],a[j+1]); } } } for(int k=0;k<n;k++) cout<<a[k].name<<" "<<a[k].score<<endl; system("pause"); return 0; }


Run Info:

Runtime Error:[ERROR] A not allowed system call.
Call ID:13