题解 | #跳台阶#
跳台阶
https://www.nowcoder.com/practice/bfb2a2b3cdbd4bd6bba0d4dca69aa3f0
import sys # for line in sys.stdin: # a = line.split() # print(int(a[0]) + int(a[1])) n = int(input()) dp =[0 for i in range(n+1)] dp[0]=1 dp[1]=1 if n ==1 or n==1: print(1) else: for i in range(2,n+1): dp[i] = dp[i-1] +dp[i-2] print(dp[n])