你输出
```cpp
printf("\n101*0.5663+184.0863=%.1f",(cnt-400)*0.5663+184.0863);
```
干嘛
by Dimly_dust @ 2020-02-20 18:31:44
你第二个if写的啥?
by yali_hzy @ 2020-02-20 18:33:43
@[Albert_Baili](/user/318856) 400以上要按三段算
by Thomasguo666 @ 2020-02-20 18:34:45
@[Thomasguo666](/user/107935) 我是三段算的。为了简化式子摸索哪里出错,184.0863是400以下前两段手算的和(原本代码长下面这样↓)
```c
#include<stdio.h>
#include<iostream>
int main()
{
int cnt;
float pay;
scanf("%d",&cnt);
if(cnt<=150){
pay=0.4463*cnt;
}
else if(151<=cnt<=400){
pay=150*0.4463+(cnt-150)*0.4663;
}
else{
pay=(150*0.4463)+(250*0.4663)+(cnt-400)*0.5663;
}
printf("%.1f",pay);
return 0;
}
```
by Albert_Baili @ 2020-02-20 18:46:56
@[缥缈于尘](/user/316896) emmmm因为同样是400以上,401能算对,501就错了,我就好奇单独输出一下501发生了什么(和题目输出要求无关哈)
by Albert_Baili @ 2020-02-20 18:50:32
第二个if错了吧,应该是
151<=cnt&&cnt<=400
by tyw_xx @ 2020-02-20 19:06:05
```cpp
#include <iostream>
using namespace std;
int main(){
int a=0;
double b=0;
cin>>a;
if(a<=150){
b = a*0.4463;
}else if(a>=151&&a<=400){
b += 150*0.4463;
b += (a-150)*0.4663;
}else{
b += 150*0.4463;
b += (400-150)*0.4663;
b += (a-400)*0.5663;
}
b=int((b*10)+0.5)/10.0;
cout<<b;
return 0;
}
```
by IFaQ @ 2020-02-20 19:17:18
@[Albert_Baili](/user/318856) 可能是碰巧一样吧
by Thomasguo666 @ 2020-02-20 19:35:57
@[tyw_xx](/user/312819) 嗷嗷嗷对,谢谢您!
by Albert_Baili @ 2020-02-20 22:42:48