樓梯走法的動態規劃算法

  有一座高度是10級臺階的樓梯,從下往上走,第步只能向上走1級或者2級,求一共有多少種走法? #include <stdio.h> #include <unistd.h> #include <stdlib.h> int *memo = NULL; int steps = 10; //普通遞歸求解 int stage(int n) {     if (n == 1) {         retur
相關文章
相關標籤/搜索