Compile Error

foo.cc: In function 'int main()':
foo.cc:11:15: error: expected ':' before '{' token
   11 |      case('+')
      |               ^
      |               :
   12 |      {
      |      ~         
foo.cc:17:4: error: case label ''-'' not within a switch statement
   17 |    case('-')
      |    ^~~~
foo.cc:17:13: error: expected ':' before '{' token
   17 |    case('-')
      |             ^
      |             :
   18 |      {
      |      ~       
foo.cc:21:7: error: break statement not within loop or switch
   21 |       break;
      |       ^~~~~
foo.cc:23:4: error: case label ''*'' not within a switch statement
   23 |    case('*')
      |    ^~~~
foo.cc:23:13: error: expected ':' before '{' token
   23 |    case('*')
      |             ^
      |             :
   24 |      {
      |      ~       
foo.cc:27:7: error: break statement not within loop or switch
   27 |       break;
      |       ^~~~~
foo.cc:29:4: error: case label ''/'' not within a switch statement
   29 |    case('/')
      |    ^~~~
foo.cc:29:13: error: expected ':' before '{' token
   29 |    case('/')
      |             ^
      |             :
   30 |      {
      |      ~       
foo.cc:33:7: error: break statement not within loop or switch
   33 |       break;
      |       ^~~~~
foo.cc:9:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
    9 |  scanf("%d,%d,%c",&a,&b,&x);
      |  ~~~~~^~~~~~~~~~~~~~~~~~~~~
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
递交
题目
P1029 简单计算器
语言
C++
递交时间
2022-07-11 21:06:45
评测时间
2022-07-11 21:06:45
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes