代码如下
#include<stdio.h>
#include<stdlib.h>
void main()
{
int long profit,bonus1,bonus2,bonus4,bonus6,bonus10,bonus;
printf("请输入当月利润\n");
scanf("%ld",&profit);
bonus1=100000*0.1;
bonus2=bonus1+100000*0.75;
bonus4=bonus2+200000*0.5;
bonus6=bonus4+200000*0.3;
bonus10=bonus6+400000*0.15;
if (profit<=100000)
bonus=profit*0.1;
else
if (profit<=200000)
bonus=bonus1+(profit-100000)*0.75;
else
if (profit<=400000)
bonus=bonus2+(profit-200000)*0.5;
else
if (profit<=600000)
bonus=bonus4+(profit-400000)*0.3;
else
if (profit<=1000000)
bonus=bonus6+(profit-600000)*0.15;
else
bonus=bonus10+(profit-1000000)*0.1;
printf("当月利润为:%ld\n当月应得奖金为:%ld\n",profit,bonus);
system("pause");
}