代码:
#include <stdio.h>
int main()
{
double income, deduction = 0;
scanf("%lf", &income);
int level = (income > 1500) +
(income > 4500) +
(income > 9000) +
(income > 35000) +
(income > 55000) +
(income > 80000) ;
switch(level)
{
case 2:
deduction += (income - 4500) * 0.2;
income = 4500;
case 1:
deduction += (income - 1500) * 0.1; income = 1500;case 0: deduction += 1500 * 0.03;
}
printf("%.2f ", deduction);
return 0;
}