题解 | #小乐乐走台阶#
小乐乐走台阶
http://www.nowcoder.com/practice/ebf04de0e02c486099d78b7c3aaec255
def steps(n):
if n==1:
return 1
elif n==2:
return 2
else:
return steps(n-1)+steps(n-2)
n=input()
print(steps(int(n)))
小乐乐走台阶
http://www.nowcoder.com/practice/ebf04de0e02c486099d78b7c3aaec255
def steps(n):
if n==1:
return 1
elif n==2:
return 2
else:
return steps(n-1)+steps(n-2)
n=input()
print(steps(int(n)))
相关推荐