# include <stdio.h>
int main()
{
int a,b,profit;
double rate,tax;
printf("input a's number:");
scanf("%d",&a);
if(a>=5000)
rate=0.15;
else b=a/500;
switch(b) {
case 0: rate=0.00;
break;
case 1:
rate=0.05;
break;
case 2:
case 3:
rate=0.08;
break;
case 4:
case 5:
case 6:
case 7:
case 8:
case 9:
rate=0.10;
break;
}
tax=a*rate;
profit=a-(int)(a*rate);
printf("%f,%f,%d",rate,tax,profit);
return 0;
}
转载于:https://www.cnblogs.com/P201821430010/p/10769102.html