走臺階

這是數據結構老師佈置的第四道題: 題目要求如下: 很典型的動態規劃問題,可以用遞歸求解,代碼如下: #include"pch.h" #include<iostream> #include<cstdio> #include<vector> using namespace std; int climbStairs(int n) { if (n == 0) return 0; if (n ==
相關文章
相關標籤/搜索