Lch6665 @ 2024-02-25 11:51:54
#include<iostream>
#include<iomanip>
using namespace std;
double n,sum;
int f;
int main(){
cin>>n;
if(n<=150) sum = n*0.4463;
if(n>=151&&n<=400) sum = 66.945+(n-150)*0.4663;
if(n>=401) sum = 183.0537+(n-400)*0.5663;
cout<<fixed<<setprecision(1)<<sum<<endl;
return 0;
}
by gavinliu266 @ 2024-02-25 12:07:49
183.0537应为183.52
by gavinliu266 @ 2024-02-25 12:10:33
0.4463
by Lch6665 @ 2024-02-25 12:12:59
@gavinliu266 已通过,感谢!!