0
已解决
赵一璇
初级守护
初级守护
#include <bits/stdc++.h>
using namespace std;
double n;
int main(){
// freopen(".in","r",stdin);
// freopen(".out","w",stdout);
cin>>n;
if(n<=3500){
cout<<"0.00";
}else if(n>3500&&n<=5000){
printf("%.2f",(n-3500)*0.03);
}else if(n>5000&&n<=8000){
printf("%.2f",(n-5000)*0.1);
}else if(n>8000&&n<=12500){
printf("%.2f",(n-8000)*0.2);
}else if(n>12500&&n<=38500){
printf("%.2f",(n-12500)*0.25);
}else if(n>38500&&n<=58500){
printf("%.2f",(n-38500)*0.3);
}else if(n>58500&&n<=835000){
printf("%.2f",(n-58500)*0.35);
}else{
printf("%.2f",(n-83500)*0.45);
}
// fclose(stdin);
// fclose(stdout);
return 0;
}
0
已采纳
万睿言
初级光能
初级光能
定义:
整型变量a
实型变量b
输入a
如果(a小于等于3500)
b等于0;
否则 如果(a小于等于5000)
b等于(a-3500)*0.03;
否则 如果(a小于等于8000)
b等于(5000-3500)*0.03+(a-5000)*0.1;
否则 如果(a小于等于12500)
b等于(5000-3500)*0.03+(8000-5000)*0.1+(a-8000)*0.2;
否则 如果(a小于等于38500)
b等于1500*0.03+(8000-5000)*0.1+(12500-8000)*0.2+(a-12500)*0.25;
否则 如果(a小于等于58500)
b等于1500*0.03+(8000-5000)*0.1+(12500-8000)*0.2+(38500-12500)*0.25+(a-38500)*0.3;
否则 如果(a小于等于83500)
b等于1500*0.03+(8000-5000)*0.1+(12500-8000)*0.2+(38500-12500)*0.25+(58500-38500)*0.3+(a-58500)*0.35;
否则
b等于1500*0.03+(8000-5000)*0.1+(12500-8000)*0.2+(38500-12500)*0.25+(58500-38500)*0.3+(83500-58500)*0.35+(a-83500)*0.45;
四舍五入保留两位小数输出b
0
0