#include <stdio.h>
int main()
{
int x,i,j;
scanf("%d",&x);
i=x/100000;
switch(i)
{
case 10:
printf("%d",j=(x-1000000)*0.01+20000);
break;
case 9:
case 8:
case 7:
case 6:
printf("%d",j=(x-600000)*0.015+20000);
break;
case 5:
case 4:
printf("%d",j=(x-400000)*0.03+20000);
break;
case 3:
case 2:
printf("%d",j=(x-200000)*0.05+20000);
break;
case 1:
printf("%d",j=(x-100000)*0.75+10000);
break;
default :
printf("%d",j=x*0.1);
}
return 0;
}
switch语句:#include <stdio.h>int main(){ int x,i,j; scanf("%d",&x); i=x/100000; switch(i) { case 10: printf("%d",j=(x-1000000)*0.01+20000); break; case 9: case 8: case 7: case 6: