解题思路:
注意事项:
参考代码:
#include <stdio.h>
int main()
{
double profit,total=0;//利润、奖金
scanf("%lf",&profit);
switch((int)profit/100000){
default:
case 10:total+=(profit-1000000)*0.01;profit=1000000;
case 9:
case 8:
case 7:
case 6:total+=(profit-600000)*0.015;profit=600000;
case 5:
case 4:total+=(profit-400000)*0.03;profit=400000;
case 3:
case 2:total+=(profit-200000)*0.05;profit=200000;
case 1:total+=(profit-100000)*0.075;profit=100000;
case 0:total+=profit*0.1;
}
printf("%.2lf\n",total);
}
0.0分
0 人评分