编程语言
首页 > 编程语言> > 程序2 企业发放的奖金根据利润提成

程序2 企业发放的奖金根据利润提成

作者:互联网

 

 代码:

#include <stdio.h>
#include <stdlib.h>

int main()
{
    long int i;
    int bouns1,bouns2,bouns4,bouns6,bouns10,bouns;
    scanf("%ld",&i);
    bouns1=100000*0.1;bouns2=bouns1+100000*0.75;
    bouns4=bouns2+200000*5;
    bouns6=bouns4+200000*0.3;
    bouns10=bouns6+400000*0.15;

        if(i<=100000)
            bouns=i*0.1;
        else if(i<=200000)
            bouns=bouns1+(i-100000)*0.075;
        else if(i<=400000)
            bouns=bouns2+(i-200000)*0.05;
        else if(i<=600000)
            bouns=bouns4+(i-400000)*0.03;
         else if(i<=1000000)
            bouns=bouns6+(i-600000)*0.015;
            else
                bouns=bouns10+(i-1000000)*0.01;
            printf("bouns=%d",bouns);
            return 0;
}

 

 运行结果:

 

 

标签:提成,int,bouns2,bouns1,bouns6,发放,奖金,bouns10,bouns4
来源: https://www.cnblogs.com/hedejia/p/14623849.html