分支循环作业题
看不懂这个错,求解
num = int(input("请输入今年的利润:"))
if num <= 100000:
reward = num*(0.1)
elif 100000 < num <= 200000:
reward = 100000*0.1 +(num - 100000)* (0.075)
elif 200000 < num <= 400000:
reward = 100000*0.1 + 100000*0.075 +(num - 200000)* (0.05)
elif 400000 < num <= 600000:
reward = 100000*0.1 + 100000*0.075 + 200000*0.05 +(num - 400000)* (0.03)
elif 600000 < num <= 1000000:
reward =(100000*0.1 + 100000*0.075+ 200000*0.05 + 200000*0.03 +(num - 600000)* (0.015)
else:
reward = 100000*0.1 + 100000*0.075+ 200000*0.05 + 200000*0.03 + 400000*0.015 +(num - 1000000)* (0.01)
print("应该发放的奖金总数是: ",reward,sep='')
else上一行后面少了个)
num = int(input("请输入今年的利润:"))
if num <= 100000:
reward = num*(0.1)
elif 100000 < num <= 200000:
reward = 100000*0.1 +(num - 100000)* (0.075)
elif 200000 < num <= 400000:
reward = 100000*0.1 + 100000*0.075 +(num - 200000)* (0.05)
elif 400000 < num <= 600000:
reward = 100000*0.1 + 100000*0.075 + 200000*0.05 +(num - 400000)* (0.03)
elif 600000 < num <= 1000000:
reward =(100000*0.1 + 100000*0.075+ 200000*0.05 + 200000*0.03 +(num - 600000)* (0.015))
else:
reward = 100000*0.1 + 100000*0.075+ 200000*0.05 + 200000*0.03 + 400000*0.015 +(num - 1000000)* (0.01)
print("应该发放的奖金总数是: ",reward,sep='')
baige 发表于 2020-9-22 23:10
else上一行后面少了个)
抱歉没看到已经回复了 baige 发表于 2020-9-22 23:10
else上一行后面少了个)
谢谢 昨非 发表于 2020-9-22 23:11
谢谢
页:
[1]