记录详情

Compile Error

/in/foo.cc: In function 'int main()':
/in/foo.cc:9:12: warning: init-statement in selection statements only available with '-std=c++17' or '-std=gnu++17' [-Wc++17-extensions]
    9 |         if(((m) << 500);
      |            ^
/in/foo.cc:9:17: error: invalid operands of types 'float' and 'int' to binary 'operator<<'
    9 |         if(((m) << 500);
      |             ~~~ ^~ ~~~
      |              |     |
      |              float int
/in/foo.cc:10:25: error: expected ')' before ';' token
   10 |         cout << m <<endl;
      |                         ^
      |                         )
/in/foo.cc:9:11: note: to match this '('
    9 |         if(((m) << 500);
      |           ^
/in/foo.cc:11:32: error: expected identifier before '(' token
   11 |         else if((m) >= 500) && ((m) << 1000))
      |                                ^
/in/foo.cc:13:39: error: invalid operands of types 'float' and 'int' to binary 'operator<<'
   13 |         else if(((m) >= 1000) && ((m) << 1500))
      |                                   ~~~ ^~ ~~~~
      |                                    |     |
      |                                    float int
/in/foo.cc:15:39: error: invalid operands of types 'float' and 'int' to binary 'operator<<'
   15 |         else if(((m) >= 1500) && ((m) << 2000))
      |                                   ~~~ ^~ ~~~~
      |                                    |     |
      |                                    float int
/in/foo.cc:17:17: warning: init-statement in selection statements only available with '-std=c++17' or '-std=gnu++17' [-Wc++17-extensions]
   17 |         else if(((m) >= 2000)
      |                 ^
/in/foo.cc:17:30: error: expected ';' before 'cout'
   17 |         else if(((m) >= 2000)
      |                              ^
      |                              ;
   18 |     cout << m*0.8 <<endl;)
      |     ~~~~                      
/in/foo.cc:17:22: warning: statement has no effect [-Wunused-value]
   17 |         else if(((m) >= 2000)
      |                 ~~~~~^~~~~~~~
/in/foo.cc:18:26: error: expected primary-expression before ')' token
   18 |     cout << m*0.8 <<endl;)
      |                          ^

信息

递交者
类型
递交
题目
P1019 contest1-4 超市促销活动
比赛
2026-11-13 C++实测1
语言
C++
递交时间
2026-11-13 20:20:27
评测时间
2026-11-13 20:20:27
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes