大会员可查看代码,点此开通大会员
#include <stdio.h>
#define N 100000
int main(){
int profit,bonus;
scanf("%d",&profit);
switch(profit/N){
case 0:
bonus=profit*0.1;
break;
case 1:
bonus=N*0.1+(profit-N)*0.075;
break;
case 2:
case 3:
bonus=N*(0.1+0.075)+(profit-N*2)*0.05;
break;
case 4:
case 5:
bonus=N*(0.1+0.075+0.05*2)+(profit-N*4)*0.03;
break;
case 6:
case 7:
case 8:
case 9:
bonus=N*(0.1+0.075+0.05*2+0.03*2)+(profit-N*6)*0.015;
break;
default:
bonus=N*(0.1+0.075+0.05*2+0.03*2+0.015*4)+(profit-N*10)*0.01;
break;
}
printf("%d",bonus);
return 0;
}