利润问题~~求解
#include<stdio.h>#include<stdlib.h>
#include<string.h>
main()
{
double profit,j=1,iprofit;
while(j>0)
{
puts("输入企业利润\n");
scanf("%d",&profit);
if(profit<=100000)/*企业profit在10万之内*/
iprofit=profit*0.1;
else if(profit<=200000)/*同上*/
iprofit=((100000*0.1)+(profit-100000)*0.75);
else if(profit<=400000)/*同上*/
iprofit=((200000*0.1)+(profit-200000)*0.5);
else if(profit<=600000)/*同上*/
iprofit=((400000*0.1)+(profit-400000)*0.3);
else
iprofit=((600000*0.1)+(profit-600000)*.01);/*企业profit超出60万*/
printf("奖金为%d\n",profit);//输出所得奖金
system("pause");
return 0;
}
}
输出奖金值很大,求正解...........