题解 | #字符个数统计#
跳台阶
http://www.nowcoder.com/practice/bfb2a2b3cdbd4bd6bba0d4dca69aa3f0
n = int(input())
占位
dp = [1,1] def qw_tj(n): if n==1 or n==2: print(1) return 1 for i in range(2,n): dp.append( dp[i-2] + dp[i-1]) print(dp[n-1]) qw_tj(n+1)
跳台阶
http://www.nowcoder.com/practice/bfb2a2b3cdbd4bd6bba0d4dca69aa3f0
n = int(input())
dp = [1,1] def qw_tj(n): if n==1 or n==2: print(1) return 1 for i in range(2,n): dp.append( dp[i-2] + dp[i-1]) print(dp[n-1]) qw_tj(n+1)
相关推荐