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