其他分享
首页 > 其他分享> > 跳台阶

跳台阶

作者:互联网

def frog(n):
if n <= 2:
return n
t1, t2 = 1, 2
for i in range(3, n+1):
t1, t2 = t2, t1+t2
return t2

n = int(input())
print(frog(n))

 

 

标签:return,int,t2,frog,t1,range,台阶
来源: https://www.cnblogs.com/lzw2019114243036/p/15339589.html