题目描述
企业发放的奖金根据利润I提成。
利润I低于或等于100000元的,奖金可提10%;
利润高于100000元,低于或等于200000元(100000<I≤200000)时,低于等于100000元部分按10%提成,高于100000元的部分,可提成 7.5%;
200000<I≤400000时,低于200000元部分仍按上述办法提成(下同),高于200000元的部分按5%提成;
400000<I≤600000元时,高于400000元的部分按3%提成;
600000<I≤1000000时,高于600000元的部分按1.5%提成;
I>1000000时,超过1000000元的部分按1%提成。
从键盘输入当月利润I,求应发奖金总数。
输入格式
一个整数,当月利润。
输出格式
一个整数,奖金。
样例输入
900
样例输出
90
#include<stdio.h>
int main()
{
int profit,bonus;
scanf("%d",&profit);
if(profit <= 100000)
{
bonus = profit * 0.1;
}
else if(profit > 100000 && profit <= 200000)
{
bonus = 100000 * 0.1 + (profit - 100000) * 0.075;
}
else if(profit > 200000 && profit <= 400000)
{
bonus = 100000 * 0.1 + 100000 * 0.075 + (profit - 200000) * 0.05;
}
else if(profit > 400000 && profit <= 600000)
{
bonus = 100000 * 0.1 + 100000 * 0.075 + 200000 * 0.05 + (profit - 400000) * 0.03;
}
else if(profit > 600000 && profit <= 1000000)
{
bonus = 100000 * 0.1 + 100000 * 0.075 + 200000 * 0.05 + 200000 * 0.03 + (profit - 600000) * 0.015;
}
else if(profit > 1000000)
{
bonus = 100000 * 0.1 + 100000 * 0.075 + 200000 * 0.05 + 200000 * 0.03 + 400000 * 0.015 + (profit - 1000000) * 0.01;
}
printf("%d\n",bonus);
return 0;
}