题解 | #小乐乐走台阶#
小乐乐走台阶
http://www.nowcoder.com/practice/ebf04de0e02c486099d78b7c3aaec255
#include<stdio.h> int zou(int x) { if (x == 2) return 2; if (x == 1) return 1; if (x == 0) return 0; return zou(x-2) +zou(x - 1); } int main() { int n,c; scanf("%d", &n); c = zou(n); printf("%d", c); return 0; }