#include <stdio.h>
#include <stdint.h>
#include <inttypes.h>
int main(void)
{
uint32_t kind;
float money, tax =0;
uint32_t single = 1, household = 2, married = 3, divorce = 4;
puts("请输入收入");
scanf_s("%f", &money);
puts("请输入类别");
scanf_s("%" PRIu32 "", &kind);
switch (kind)
{
case 1: if (money < 17850)
{
tax = money * 0.15;
}
else
{
tax = 2677.5 + (money - 17850) * 0.28;
}
break;
case 2: if (money < 23900)
{
tax = money * 0.15;
}
else
{
tax = 3585.0 + (money - 23900) * 0.28;
}
break;
case 3: if (money < 29750)
{
tax = money * 0.15;
}
else
{
tax = 4462.5 + (money - 29750) * 0.28;
}
break;
case 4: if (money < 14875)
{
tax = money * 0.15;
}
else
{
tax = 2231.25 + (money - 14875) * 0.28;
}
break;
default: printf("无效输入,请重新输入\n");
return 1;
}
printf("所缴税金为%.2f", tax);
return 0;
}
c primer plus 7.12.10
最新推荐文章于 2024-10-10 06:15:00 发布
本文介绍了一个用C语言编写的程序,用于根据不同的收入类别(单身、家庭、已婚和离婚)计算所得税。根据月收入的不同阶段,采用不同的税率计算税金。
摘要由CSDN通过智能技术生成