写一个C语言程序使任意输入一个月收入,计算当月应交纳的税额
时间: 2023-05-30 11:03:06 浏览: 130
#include<stdio.h>
int main()
{
float income, tax;
printf("请输入您的月收入:");
scanf("%f", &income);
if(income <= 0)
{
printf("您输入的月收入有误,请重新输入!\n");
return 0;
}
else if(income <= 5000)
{
tax = 0;
}
else if(income <= 8000)
{
tax = (income - 5000) * 0.03;
}
else if(income <= 17000)
{
tax = (income - 8000) * 0.1 + 900;
}
else if(income <= 30000)
{
tax = (income - 17000) * 0.2 + 2600;
}
else if(income <= 40000)
{
tax = (income - 30000) * 0.25 + 4600;
}
else if(income <= 60000)
{
tax = (income - 40000) * 0.3 + 9600;
}
else if(income <= 85000)
{
tax = (income - 60000) * 0.35 + 14600;
}
else
{
tax = (income - 85000) * 0.45 + 21600;
}
printf("您的月税额为:%.2f元\n", tax);
return 0;
}
阅读全文