1 回答
要微笑着写Bug呀
TA贡献9条经验 获得超1个赞
看你这个我测着头看得好累
int main()
{
double i;
int bon,bon1,bon2,bon4,bon6,bon10;
printf("请输入利润i:");
scanf("%d",&i);
bon1=100000*0.1;
bon2=bon1+100000*0.075;
bon4=bon2+200000*0.05;
bon6=bon4+200000*0.03;
bon10=bon6+400000*0.015;
if(i<=100000){
bon=i*0.1;
}else if(i<=200000){
bon=bon1+(i-100000)*0.075;
}
else if(i<=400000){
bon=bon2+(i-200000)*0.05;
}
else if(i<=600000){
bon=bon4+(i-400000)*0.03;
}
else if(i<=1000000){
bon=bon6+(i-600000)*0.01;
}
else{
bon=bon10+(i-1000000)*0.01;
}
printf("提成为:bon=%f",bon);
}
- 1 回答
- 0 关注
- 912 浏览
添加回答
举报
0/150
提交
取消