int main()
{ float profit,bonus; int i; printf("please input the profits(unit:ten thousand):"); scanf("%f",&profit); if(profit>=100) i=10; else i=(int)(profit/10); switch(i) { case 0: bonus=profit*0.1;break; case 1: bonus=10*0.1+(profit-10)*0.075;break; case 2: case 3: bonus=10*0.1+10*0.075+(profit-20)*0.05;break; case 4: case 5: bonus=10*0.1+10*0.075+20*0.05+(profit-40)*0.03;break; case 6: case 7: case 8: case 9: bonus=10*0.1+10*0.075+20*0.05+20*0.03+(profit-60)*0.015;break; case 10:bonus=10*0.1+10*0.075+20*0.05+20*0.03+40*0.015+(profit-100)*0.01;break; } printf("The bonus is %f (ten thousand).\n",bonus); system("pause"); return 0;
}