题解 | #小乐乐走台阶#
小乐乐走台阶
https://www.nowcoder.com/practice/ebf04de0e02c486099d78b7c3aaec255
#include <stdio.h> int num(int n) { return n<=2?n:num(n-1)+num(n-2); //如果n<=2;输出n,否则输出num(n-1)+num(n-2) } int main() { int a; scanf("%d",&a); printf("%d",num(a)); return 0; }#菜狗的解题#