题解 | #跳台阶#
跳台阶
https://www.nowcoder.com/practice/bfb2a2b3cdbd4bd6bba0d4dca69aa3f0
#include <stdio.h> int cal(int n){ if(n < 0){ return -1; } return n <= 1 ? 1 : cal(n-1) + cal(n-2); } int main() { int a; //2; scanf("%d", &a); printf("%d", cal(a)); return 0; }