题解 | #小乐乐走台阶#

小乐乐走台阶

https://www.nowcoder.com/practice/ebf04de0e02c486099d78b7c3aaec255

def step(n):
    if n==1:
        return 1
    elif n==2:
        return 2
    else:
        return step(n-1)+step(n-2)
n=int(input())
print(step(n))

全部评论

相关推荐

评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务