看一下,这程序该怎么简化一下 ,我搞的老报错
#include<stdio.h>#include<math.h>
#include<string.h>
main()
{
float jiangj;
long int lirun;
clrscr();
printf("Please intput your lirun:");
scanf("%ld",&lirun);
if(lirun<=100000)
jiangj=lirun*0.1;
else if(lirun>100000&&lirun<=200000)
jiangj=100000*0.1+((lirun-100000)*0.075);
else if(lirun>200000&&lirun<=400000)
jiangj=(100000*0.1+((lirun-100000)*0.075))+((lirun-200000)*0.05);
else if(lirun>400000&&lirun<=600000)
jiangj=((100000*0.1+((lirun-100000)*0.075))+((lirun-200000)*0.05))+(lirun-400000)*0.03;
else if(lirun>600000&&lirun<=1000000)
jiangj=(((100000*0.1+((lirun-100000)*0.075))+((lirun-200000)*0.05))+(lirun-400000)*0.03)+(1000000-600000)*0.015;
else if(lirun>1000000)
jiangj=((((100000*0.1+((lirun-100000)*0.075))+((lirun-200000)*0.05))+(lirun-400000)*0.03)+(1000000-600000)*0.015)+(lirun-1000000)*0.01;
printf("%.2f",jiangj);
getch();
}