Compile Error

/in/foo.cc:4:1: error: expected initializer before 'double'
    4 | double m;
      | ^~~~~~
/in/foo.cc: In function 'int main()':
/in/foo.cc:7:14: error: 'n' was not declared in this scope; did you mean 'yn'?
    7 |         cin>>n;
      |              ^
      |              yn
/in/foo.cc:8:19: error: 'm' was not declared in this scope; did you mean 'tm'?
    8 |         if(n<=150)m=n*0.4463;
      |                   ^
      |                   tm
/in/foo.cc:9:31: error: 'm' was not declared in this scope; did you mean 'tm'?
    9 |         else if(n<=400&&n>150)m=150*0.4463+(n-150)*0.4663;
      |                               ^
      |                               tm
/in/foo.cc:10:23: error: 'm' was not declared in this scope; did you mean 'tm'?
   10 |         else if(n>400)m=150*0.4463+250*0.4663+(n-400)*0.5663;
      |                       ^
      |                       tm
/in/foo.cc:11:39: error: 'm' was not declared in this scope; did you mean 'tm'?
   11 |         cout<<fixed<<setprecision(1)<<m;
      |                                       ^
      |                                       tm

信息

递交者
类型
递交
题目
P2997 电费计算(money)
语言
C++
递交时间
2025-12-27 21:49:07
评测时间
2025-12-27 21:49:07
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes