输出了 44.613.6 不知道怎么回事
by w1c8 @ 2022-08-27 08:19:42
第二个if前面加个else
by WhiteSunFlower @ 2022-08-27 08:31:00
@[w1c8](/user/771044)
by WhiteSunFlower @ 2022-08-27 08:32:36
@[WhiteSunFlower](/user/191846) 谢谢(我怎么犯了这错误。。。)
by w1c8 @ 2022-08-27 08:39:18
@[w1c8](/user/771044) 一看你输出就知道什么错
by WhiteSunFlower @ 2022-08-27 08:40:44
A了。。。
```
#include <bits/stdc++.h>
using namespace std;
signed main()
{
int x;
double y;
cin >> x;
if (x<=150)
{
y=x*0.4463;
printf("%.1f",y);
}
else if (x<=400)
{
y=150*0.4463+(x-150)*0.4663;
printf("%.1f",y);
}
else if (x>=401)
{
y=150*0.4463+(400-150)*0.4663+(x-400)*0.5663;
printf("%.1f",y);
}
return 0;
}
```
@ [w1c8](https://www.luogu.com.cn/user/771044)
by SZH0523 @ 2022-08-27 08:43:30