Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
106608 陈奕涵 输出成绩等级II C++ Compile Error 0 MS 0 KB 619 2025-01-16 14:07:56

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 a; cin>>a; switch(d) { case a>=90: cout<<"A"<<endl; break; case a>=70&&a<90: cout<<"B"<<endl; break; case a>=60&&a<70: cout<<"C"<<endl;; break; case a>60: cout<<"D"<<endl; break; } return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:10:12: error: 'd' was not declared in this scope
     switch(d)
            ^
Main.cc:12:17: error: the value of 'a' is not usable in a constant expression
         case a>=90:
                 ^
Main.cc:8:10: note: 'int a' is not const
      int a;
          ^
Main.cc:12:17: error: the value of 'a' is not usable in a constant expression
         case a>=90:
                 ^
Main.cc:8:10: note: 'int a' is not const
      int a;
          ^
Main.cc:15:23: error: the value of 'a' is not usable in a constant expression
         case a>=70&&a<90:
                       ^
Main.cc:8:10: note: 'int a' is not const
      int a;
          ^
Main.cc:15:23: error: the value of 'a' is not usable in a constant expression
         case a>=70&&a<90:
                       ^
Main.cc:8:10: note: 'int a' is not const
      int a;
          ^
Main.cc:18:23: error: the value of 'a' is not usable in a constant expression
         case a>=60&&a<70:
                       ^
Main.cc:8:10: note: 'int a' is not const
      int a;
          ^
Main.cc:18:23: error: the value of 'a' is not usable in a constant expression
         case a>=60&&a<70:
                       ^
Main.cc:8:10: note: 'int a' is not const
      int a;
          ^
Main.cc:21:16: error: the value of 'a' is not usable in a constant expression
         case a>60:
                ^
Main.cc:8:10: note: 'int a' is not const
      int a;
          ^
Main.cc:21:16: error: the value of 'a' is not usable in a constant expression
         case a>60:
                ^
Main.cc:8:10: note: 'int a' is not const
      int a;
          ^