Compile Error

foo.cc: In function 'int main()':
foo.cc:10:35: error: expected ';' before '}' token
   10 |                 printf("%.2f",sum)
      |                                   ^
      |                                   ;
   11 |         }
      |         ~                          
foo.cc:12:14: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
   12 |         else if(n1>=1000)
      |              ^~
foo.cc:14:17: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
   14 |                 printf("%.2f",sum)
      |                 ^~~~~~
foo.cc:14:35: error: expected ';' before 'else'
   14 |                 printf("%.2f",sum)
      |                                   ^
      |                                   ;
   15 |         else if(n1>=1500)
      |         ~~~~                       
foo.cc:20:9: error: 'else' without a previous 'if'
   20 |         else if(n1>=2000)
      |         ^~~~
foo.cc:23:35: error: expected ';' before '}' token
   23 |                 printf("%.2f",sum)
      |                                   ^
      |                                   ;
   24 |         }
      |         ~                          
foo.cc:27:25: error: expected ';' before 'printf'
   27 |                 sum = n1
      |                         ^
      |                         ;
   28 |                 printf("%.2f",sum)
      |                 ~~~~~~   
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
递交
题目
P1026 超市促销活动
语言
C++
递交时间
2023-12-15 16:32:09
评测时间
2023-12-15 16:32:09
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes