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