自己写的。fun(n)=fun(n-1)+fun(n-2)
统计每个月兔子的总数
https://www.nowcoder.com/practice/1221ec77125d4370833fd3ad5ba72395
#include<stdio.h> int fun(int); int main() { int n; scanf("%d", &n); printf("%d\n", fun(n)); return 0; } int fun(int n) { if (n == 1 || n == 2) { return 1; } return fun(n - 1) + fun(n - 2); }