回复 22楼 dong152liang
#include <stdio.h>
void main()
{
float I,Q;int t;
scanf("%f",&I);
if(I<0)printf("it is not right\n");
else{
if(I>=1000000)Q=0.1*100000+0.075*100000+0.05*200000+0.03*200000+0.015*400000+0.01*(I-1000000);
else t=I/100000;
switch(t)
{
case 0:Q=0.1*I;break;
case 1:Q=0.1*100000+0.075*(I-100000);break;
case 2:
case 3:Q=0.1*100000+0.075*100000+0.05*(I-200000);break;
case 4:
case 5:Q=0.1*100000+0.075*100000+0.05*200000+0.03*(I-400000);break;
case 6:
case 7:
case 8:
case 9:Q=0.1*100000+0.075*100000+0.05*200000+0.03*200000+0.015*(I-1000000);break;
}
printf("Q=%f\n",Q);
}
}
这个在VC上可以运行,楼主有几个字母和括号是全角,所以不能运行