记录详情

Compile Error

/in/foo.cc: In function 'int main()':
/in/foo.cc:9:10: error: expression '(n = 0)' is not a constant-expression
   case n = 0: cout << "Sunday"; 
        ~~^~~
/in/foo.cc:9:12: error: modification of 'n' is not a constant-expression
   case n = 0: cout << "Sunday"; 
            ^
/in/foo.cc:10:10: error: expression '(n = 0)' is not a constant-expression
   case n = 0: cout << "Monday"; 
        ~~^~~
/in/foo.cc:10:3: error: case label '(n = 0)' not within a switch statement
   case n = 0: cout << "Monday"; 
   ^~~~
/in/foo.cc:11:10: error: expression '(n = 0)' is not a constant-expression
   case n = 0: cout << "Tuesday"; 
        ~~^~~
/in/foo.cc:11:3: error: case label '(n = 0)' not within a switch statement
   case n = 0: cout << "Tuesday"; 
   ^~~~
/in/foo.cc:12:10: error: expression '(n = 0)' is not a constant-expression
   case n = 0: cout << "Wednesday"; 
        ~~^~~
/in/foo.cc:12:3: error: case label '(n = 0)' not within a switch statement
   case n = 0: cout << "Wednesday"; 
   ^~~~
/in/foo.cc:13:10: error: expression '(n = 0)' is not a constant-expression
   case n = 0: cout << "Thursday"; 
        ~~^~~
/in/foo.cc:13:3: error: case label '(n = 0)' not within a switch statement
   case n = 0: cout << "Thursday"; 
   ^~~~
/in/foo.cc:14:10: error: expression '(n = 0)' is not a constant-expression
   case n = 0: cout << "Friday"; 
        ~~^~~
/in/foo.cc:14:3: error: case label '(n = 0)' not within a switch statement
   case n = 0: cout << "Friday"; 
   ^~~~
/in/foo.cc:15:10: error: expression '(n = 0)' is not a constant-expression
   case n = 0: cout << "Saturday"; 
        ~~^~~
/in/foo.cc:15:3: error: case label '(n = 0)' not within a switch statement
   case n = 0: cout << "Saturday"; 
   ^~~~
/in/foo.cc:16:4: error: case label not within a switch statement
    default : cout << "error!";
    ^~~~~~~

信息

递交者
类型
递交
题目
P1008 星期判断机
语言
C++
递交时间
2024-11-06 17:38:19
评测时间
2024-11-06 17:38:19
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes