新手求解,麻烦各位朋友看一下代码哪儿出错了
#include<stdio.h>
int main()
{
float i,s;
scanf("%f",&i);
i=i/10000;
if(i<=10)
s=i*0.1;
else if(i>10&&i<=20)
s=10*0.1+(i-10)*0.075;
else if(i>20&&i<=40)
s=10*0.1+10*0.075+(i-20)*0.05;
else if(i>40&&i<=60)
s=10*0.1+10*0.075+20*0.05+(i-40)*0.03;
else if(i>60&&i<=100)
s=10*0.1+10*0.075+20*0.05+20*0.03+(i-60)*0.015;
else if(i>100)
s=10*0.1+10*0.075+20*0.05+20*0.03+40*0.015+(i-100)*0.001;
s=s*10000;
printf("%f\n",s);
}
[此贴子已经被作者于2017-8-4 22:35编辑过]