income = int(input("请输入月工资:"))

if income <= 3000:
    tax = 0
elif 3000 < income <= 4500:
    tax = (income - 3000) * 0.05
elif 4500 < income <= 9000:
    tax = 1500 * 0.05 + (income - 4500) * 0.1
elif 9000 < income <= 35000:
    tax = 1500 * 0.05 + 4500 * 0.1 + (income - 9000) * 0.25
elif 35000 < income <= 55000:
    tax = 1500 * 0.05 + 4500 * 0.1 + 26000 * 0.25 + (income - 35000) * 0.3
elif 55000 < income <= 80000:
    tax = 1500 * 0.05 + 4500 * 0.1 + 26000 * 0.25 + 20000 * 0.3 + (income - 55000) * 0.35
else:
    tax = 1500 * 0.05 + 4500 * 0.1 + 26000 * 0.25 + 20000 * 0.3 + 25000 * 0.35 + (income - 80000) * 0.45

print("你要交的税为:" + str(tax))

注意:上面的代码假设输入的月工资是整数,如果输入是小数,可以将int(input("请输入月工资:"))改为float(input("请输入月工资:"))


原文地址: https://www.cveoy.top/t/topic/iJuk 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录