#include "stdio.h"
int main(int, const char *)
{
double dSalary,dTax=0,dNetIncome=0,dValue,rate,cut;
int A;
printf("请输入您本月的收入额度(元):");
scanf("%lf",&dSalary);
dValue=dSalary-3500.00;
if(dValue<=0.00)
{
dTax=0.00;
}
else
{
if (dValue<=1500)
{
A=1;
}
else if (dValue<=4500)
{
A=2;
}
else if (dValue<=9000)
{
A=3;
}
else if (dValue<=35000)
{
A=4;
}
else if (dValue<=55000)
{
A=5;
}
else
{
A=6;
}
switch(A)
{
case 1:
rate=0.03,cut=0;break;
case 2:
rate=0.1,cut=105;break;
case 3:
rate=0.2,cut=555;break;
case 4:
rate=0.25,cut=1005;break;
case 5:
rate=0.3,cut=2755;break;
case 6:
rate=0.35,cut=2755;break; //假设高于55000元以上税率0.35,扣除数2755
}
dTax=dValue*rate-cut;
}
dNetIncome=dSalary-dTax;
printf("您本月应缴个人所得税:%.2f元,税后收入是%.2lf元\n",dTax,dNetIncome);
}
|