|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
1。
num=int(input('请输入今年的利润:'))
if num<=100000:
print("应该发放的奖金总数是:",num*0.1)
elif 100000<num<=200000:
print("应该发放的奖金总数是:",100000*0.1+(num-100000)*0.075)
elif 200000<num<=400000:
print("应该发放的奖金总数是:",100000*0.1+100000*0.075+(num-200000)*0.05)
elif 400000<num<=600000:
print("应该发放的奖金总数是:",100000*0.1+100000*0.075+200000*0.05+(num-400000)*0.03)
elif 600000<num<=1000000:
print("应该发放的奖金总数是:",100000*0.1+100000*0.075+200000*0.05+200000*0.03+(num-600000)*0.015)
elif num>1000000:
print("应该发放的奖金总数是:",100000*0.1+100000*0.075+200000*0.05+200000*0.03+400000*0.015+(num-1000000)*0.01)
小甲鱼在标准答案中用了float用来把利润取浮点数,为什么不是int取整呢?
profit = float(input("请输入今年的利润:"))
if profit <= 100000:
reward = profit * 0.1
elif 100000 < profit <= 200000:
reward = 100000 * 0.1 + (profit - 100000) * 0.075
elif 200000 < profit <= 400000:
reward = 100000 * 0.1 + 100000 * 0.075 + (profit - 200000) * 0.05
elif 400000 < profit <= 600000:
reward = 100000 * 0.1 + 100000 * 0.075 + 200000 * 0.05 + (profit - 400000) * 0.03
elif 600000 < profit <= 1000000:
reward = 100000 * 0.1 + 100000 * 0.075 + 200000 * 0.05 + 200000 * 0.03 + (profit - 600000) * 0.015
else:
reward = 100000 * 0.1 + 100000 * 0.075 + 200000 * 0.05 + 200000 * 0.03 + 400000 * 0.015 + (profit - 1000000) * 0.01
print("应该发放的奖金总数是:", reward, sep='')
|
|