python代码块:
def test(profile):
# while True:
if profile>0 and profile<=100000:
bonus = profile*0.01
print(bonus)
elif profile>100000 and profile<=200000:
bonus = 100000*0.1 + (profile-100000)*0.075
print(bonus)
elif profile>200000 and profile<=400000:
bonus = 100000*0.1 + 100000*0.075 + (profile-200000)*0.05
print(bonus)
elif profile>400000 and profile<=600000:
bonus = 100000*0.1 + 100000*0.075 + 200000*0.05 + (profile-400000)*0.03
print(bonus)
elif profile>600000 and profile<=1000000:
bonus = 100000*0.1 + 100000*0.075 + 200000*0.05 + 200000*0.03 + (profile-600000)*0.015
print(bonus)
elif profile>1000000:
bonus = 100000*0.1 + 100000*0.075 + 200000*0.05 + 200000*0.03 + 400000*0.015 + (profile-600000)*0.01
print(bonus)
# elif profile == 0:
# break
def main():
profile = 1
while profile != 0:
profile = int(input('请输入利润/元'))
test(profile)
main()