题解 | #统计每个月兔子的总数#
统计每个月兔子的总数
https://www.nowcoder.com/practice/1221ec77125d4370833fd3ad5ba72395
#include <iostream> using namespace std; int main() { int n, n_0, n_1, n_2, sum; cin >> n; n_0 = 0; n_1 = 0; n_2 = 1; for (int i = 3; i <= n; ++i){ n_2 = n_2 + n_1; n_1 = n_0; n_0 = n_2; } sum = n_0 + n_1 + n_2; cout << sum << endl; return 0; }#23届找工作求助阵地##我的实习求职记录##14天打卡计划##零基础学习C++#