Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
93971 | 石依灵 | 成绩排序 | C++ | Compile Error | 0 MS | 0 KB | 415 | 2024-10-19 16:44:44 |
#include<iostream> using namespace std; struct student{ string name; int a; } student stu[10]; int main(){ for(int i=1;i=0;<10;i++){ cin>>stu[i].name; cin>>stu[i].a; } for(int i=0;i<9;i++){ for(int j=0;j<9-i;j++){ if(stu[j].a<stu[j+1].a){ swap(stu[j],stu[j+1]); } } } return 0; }
Main.cc:7:9: error: expected initializer before 'stu' student stu[10]; ^ Main.cc: In function 'int main()': Main.cc:9:19: warning: suggest parentheses around assignment used as truth value [-Wparentheses] for(int i=1;i=0;<10;i++){ ^ Main.cc:9:21: error: expected primary-expression before '<' token for(int i=1;i=0;<10;i++){ ^ Main.cc:9:24: error: expected ')' before ';' token for(int i=1;i=0;<10;i++){ ^ Main.cc:9:25: error: 'i' was not declared in this scope for(int i=1;i=0;<10;i++){ ^ Main.cc:15:16: error: 'stu' was not declared in this scope if(stu[j].a