Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
140723 向睿杰 输出成绩等级II C++ Compile Error 0 MS 0 KB 699 2025-12-20 10:58:32

Tests(0/0):


Code:

#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; n/=10; switch(n);{ case 10; case 9; cout<<"A"; break; case 7; case 8; cout<<"B"; break; case 6; cout<<"C"; break; default; cout<<"D"; } return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:12:15: error: case label '10' not within a switch statement
               case 10;
               ^
Main.cc:12:22: error: expected ':' before ';' token
               case 10;
                      ^
Main.cc:13:15: error: case label '9' not within a switch statement
               case 9;
               ^
Main.cc:13:21: error: expected ':' before ';' token
               case 9;
                     ^
Main.cc:15:23: error: break statement not within loop or switch
                       break;
                       ^
Main.cc:16:15: error: case label '7' not within a switch statement
               case 7;
               ^
Main.cc:16:21: error: expected ':' before ';' token
               case 7;
                     ^
Main.cc:17:15: error: case label '8' not within a switch statement
               case 8;
               ^
Main.cc:17:21: error: expected ':' before ';' token
               case 8;
                     ^
Main.cc:19:23: error: break statement not within loop or switch
                       break;
                       ^
Main.cc:20:15: error: case label '6' not within a switch statement
               case 6;
               ^
Main.cc:20:21: error: expected ':' before ';' token
               case 6;
                     ^
Main.cc:22:23: error: break statement not within loop or switch
                       break;
                       ^
Main.cc:23:15: error: case label not within a switch statement
               default;
               ^
Main.cc:23:22: error: expected ':' before ';' token
               default;
                      ^