13.企业发放的奖金根据利润提成

 1 #include <stdio.h>
 2 #include <stdlib.h>
 3 
 4 int main()
 5 {
 6     int i;
 7     double bonus;
 8     scanf("%d",&i);
 9     if(i<=100000)
10         bonus = i*0.1;
11     else if(i<=200000)
12         bonus = 100000*0.1+(i-100000)*0.075;
13     else if(i<=400000)
14         bonus = 100000*0.1+100000*0.075+(i-200000)*0.05;
15     else if(i<=600000)
16         bonus = 100000*0.1+100000*0.075+200000*0.05+(i-400000)*0.03;
17     else if(i<=1000000)
18         bonus = 100000*0.1+100000*0.075+200000*0.05+200000*0.03+(i-600000)*0.015;
19     else
20         bonus = 100000*0.1+100000*0.075+200000*0.05+200000*0.03+400000*0.015+(i-1000000)*0.01;
21     printf("奖金是 :%10.2f\n",bonus);
22     return 0;
23 }

 

posted @ 2019-01-23 10:59  小孢子  阅读(256)  评论(0编辑  收藏  举报