题解 | #统计每个月兔子的总数#
统计每个月兔子的总数
https://www.nowcoder.com/practice/1221ec77125d4370833fd3ad5ba72395
const rl = require("readline").createInterface({ input: process.stdin }); var iter = rl[Symbol.asyncIterator](); const readline = async () => (await iter.next()).value; void async function () { // Write your code here const n = parseInt(await readline()); let arr = new Array(n); arr[0] = 1; arr[1] = 1; for(let i = 2; i < n; i++){ arr[i] = arr[i-1] + arr[i -2]; } console.log(arr[n-1]) }()