用c语言写一个计算个税的程序
时间: 2023-05-19 13:04:00 浏览: 138
好的,以下是一个简单的计算个税的程序,使用C语言编写:
#include <stdio.h>
int main() {
float income, tax;
printf("请输入您的收入:");
scanf("%f", &income);
if (income <= 0) {
printf("您输入的收入不合法!\n");
return 0;
}
if (income <= 5000) {
tax = 0;
} else if (income <= 8000) {
tax = (income - 5000) * 0.03;
} else if (income <= 17000) {
tax = (income - 8000) * 0.1 + 450;
} else if (income <= 30000) {
tax = (income - 17000) * 0.2 + 1450;
} else if (income <= 40000) {
tax = (income - 30000) * 0.25 + 3450;
} else if (income <= 60000) {
tax = (income - 40000) * 0.3 + 7950;
} else if (income <= 85000) {
tax = (income - 60000) * 0.35 + 13950;
} else {
tax = (income - 85000) * 0.45 + 22495;
}
printf("您的个人所得税为:%.2f 元\n", tax);
return 0;
}
请注意,这只是一个简单的计算个税的程序,实际的个税计算可能会更加复杂,具体的计算方法请参考相关法律法规。
阅读全文