# 税前工资分段
mon = [3500,3500+1500,3500+4500,3500+9000,3500+35000,3500+55000,3500+80000]
# mon = [3500, 5000, 8000, 12500, 38500, 58500, 83500]
# 税率
tax = [0.03,0.1,0.2,0.25,0.3,0.35,0.45]
# 税后工资分段
tax_range = [3500]
for i in range(1,len(tax)):
tax_range += [int(tax_range[i-1] + (mon[i] - mon[i-1]) * (1-tax[i-1]))]
# tax_range = [3500, 4955, 7655, 11255, 30755, 44755, 61005]
t = int(input())
if t >= tax_range[6]:
x = 6
else:
for i in range(len(tax_range)-1):
while t >= tax_range[i] and t <= tax_range[i+1]:
x = i
break
if t <= 3500:
s = t
else:
s = mon[x] + (t-tax_range[x]) / (1-tax[x])
print(int(s))
CCF 201612-2工资计算 python
最新推荐文章于 2024-09-23 10:31:04 发布