"""
编写一个程序计算个人所得税(以下为个人所得税税率表,3500元起征):
应纳税所得额(含税) 税率(%)
不超过1500元的 3
超过1500元至4,500元的部分 10
超过4,500元至9,000元的部分 20
超过9,000元至35,000元的部分 25
超过35,000元至55,000元的部分 30
超过55,000元至80,000元的部分 35
超过80,000元的部分 45
"""
这到题目有难度
salary = input("输入您的月薪:")
temp = int(salary) - 3500
if temp <= 0:
print("elif 0 < temp < 1500:您的月薪为%d元不需要纳税"%int(salary))
elif 0 < temp <= 1500:
tax = temp*0.03
elif 1500 < temp <= 4500:
tax = (temp - 1500)*0.1 + 45
#1500*0.03
elif 4500 < temp <= 9000:
tax = (temp - 4500)*0.2 + 345
#1500*0.03+(4500-1500)*0.1
elif 9000 < temp <= 35000:
tax = (temp - 9000)*0.25 + 1245
#1500*0.03+(4500-1500)*0.1+(9000-4500)*0.2
elif 35000 < temp <= 55000:
tax = (temp - 35000)*0.3 + 7745
#1500*0.03+(4500-1500)*0.1+(9000-4500)*0.2+(35000-9000)*0.25
elif 55000 < temp <= 80000:
tax = (temp - 55000)*0.35 + 13745
#1500*0.03+(4500-1500)*0.1+(9000-4500)*0.2+(35000-9000)*0.25+(55000-35000)*0.3
elif temp > 80000:
tax = (temp - 80000)*0.45 + 22495
#1500*0.03+(4500-1500)*0.1+(9000-4500)*0.2+(35000-9000)*0.25+(55000-35000)*0.3+(80000-55000)*0.35
print("您的月薪为%d元,应纳税额%d元"%(int(salary),tax))
网友评论