题解 | #小乐乐走台阶#
小乐乐走台阶
https://www.nowcoder.com/practice/ebf04de0e02c486099d78b7c3aaec255
#include <stdio.h> int Steps(int n) { if(n == 0) return 0; if(n == 1) return 1; if(n == 2) return 2; return Steps(n-1) + Steps(n-2); } int main() { int n = 0; scanf("%d", &n); int st = Steps(n); printf("%d", st); return 0; }
求走一步的走法加上走两步的走法