解题思路:使用递归实现
注意事项:
参考代码:
n=int(input()) def func(n): if n<=100000: result=n*0.1 elif 100000<n<=200000: result=func(100000)+(n-100000)*0.075 elif 200000<n<=400000: result=func(200000)+(n-200000)*0.05 elif 400000<n<=600000: result=func(400000)+(n-400000)*0.03 elif 600000<n<=1000000: result=func(600000)+(n-600000)*0.015 else: result=func(1000000)+(n-1000000)*0.01 return result print(int(func(n)))
0.0分
11 人评分