好麽 60分?求助 大~脑!!

P1422 小玉家的电费

标题语无伦次 第二个那个else if错了
by wheneveright @ 2021-03-30 16:08:55


@[wheneveright](/user/189351) ``` #include<iostream> #include<cstdio> #include<cstring> #include<string> #include<cmath> using namespace std; int main() { int a; double b; cin>>a; if (a<=150) b=a*0.4463; else if (151<=a && a<=400) b=(a-150)*0.4663+150*0.4463; else b=(a-400)*0.5663+250*0.4663+150*0.4463; cout<<floor(b*10+0.5)/10.0; return 0; } ``` 谢谢 AC了 语法没出错 我手算得四舍五入后就错了 谢谢
by 俗人温~ @ 2021-03-30 16:15:53


|