结果比实际少了1,求教!
#include <stdio.h>#include <string.h>
int main()
{
int value; //定义利润
//float sum[6]={0.1,0.075,0.05,0.03,0.015,0.001};//定义奖金提成率
float sum=0; //定义奖金提成
printf("请输入利润值:");
scanf("%d",&value);
if(value<=10)
sum=value*0.1;
else if(value<=20)
sum=(value-10)*0.075+sum;
else if(value<=40)
sum=sum+(value-20)*0.05;
else if(value<=60)
sum=sum+(value-40)*0.03;
else if(value<=100)
sum=sum+(value-60)*0.015;
else
sum=sum+(value-100)*0.01;
printf("\n奖金为%.3f",sum);
scanf("%d",&value);
return 0;
}