lcm_zg 于 2016.04.08 21:54 提问

#include

void count(double profit);

int main()
{
double pro;
//printf("请输入利润:");
//scanf("%f",pro); //为什么不能输入？？？？？？？？？？？？
count(660000);
return 0;
}

void count(double profit)
{
double prize[5];
double bonus;
int pro = profit/10000;
prize[0] = 100000*10*0.01;
prize[1] = prize[0]+100000*7.5*0.01;
prize[2] = prize[1]+200000*5*0.01;
prize[3] = prize[2]+200000*3*0.01;
prize[4] = prize[3]+400000*1.5*0.01;
if(pro<=10)
{

bonus = pro*0.1;

}
else if(pro<=20)
{

bonus = prize[0]+(profit-100000)*0.075;
}
else if(pro<=40)
{

bonus = prize[1]+(profit-200000)*0.05;
}
else if(pro<=60)
{

bonus = prize[2]+(profit-400000)*0.03;
}
else if(pro<=100)
{

bonus = prize[3]+(profit-600000)*0.015;
}
else if(pro>100)
{

bonus = prize[4]+(profit-1000000)*0.01;
}
printf("当月奖金为：%f",bonus);

}

2个回答

qq423399099      2016.04.08 22:03

`````` scanf("%lf",&pro);
``````
lcm_zg 谢谢

CSDNXIAON   2016.04.08 22:03

C语言函数调用性能测试
----------------------同志你好，我是CSDN问答机器人小N，奉组织之命为你提供参考答案，编程尚未成功，同志仍需努力！