Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
101511 | 袁龙浩 | 输出成绩等级II | C++ | Compile Error | 0 MS | 0 KB | 519 | 2024-12-15 14:04:23 |
#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; int main(){ int n; cin>>n; switch(n){ case n>=90:cout<<'A'; break; case n>=70 || a<90:cout<<'B'; break; case n>=60 || a<70:cout<<'C'; break; case n<60:cout<<'D'; break; } return 0; }
Main.cc: In function 'int main()': Main.cc:11:17: error: the value of 'n' is not usable in a constant expression case n>=90:cout<<'A'; ^ Main.cc:8:9: note: 'int n' is not const int n; ^ Main.cc:11:17: error: the value of 'n' is not usable in a constant expression case n>=90:cout<<'A'; ^ Main.cc:8:9: note: 'int n' is not const int n; ^ Main.cc:13:23: error: 'a' was not declared in this scope case n>=70 || a<90:cout<<'B'; ^ Main.cc:17:16: error: the value of 'n' is not usable in a constant expression case n<60:cout<<'D'; ^ Main.cc:8:9: note: 'int n' is not const int n; ^ Main.cc:17:16: error: the value of 'n' is not usable in a constant expression case n<60:cout<<'D'; ^ Main.cc:8:9: note: 'int n' is not const int n; ^