0
点赞
收藏
分享

微信扫一扫

P1255 数楼梯 方法一(python3实现)

https://www.luogu.com.cn/problem/P1255


"""
P1255 数楼梯 方法一
https://www.luogu.com.cn/problem/P1255

"""
a=[0 for i in range(5010)]

a[1]=1
a[2]=2

n=int(input())

for i in range(3,n+1):
    a[i]=a[i-1]+a[i-2]
    
print(a[n])


举报

相关推荐

0 条评论