题解 | #统计每个月兔子的总数#
统计每个月兔子的总数
https://www.nowcoder.com/practice/1221ec77125d4370833fd3ad5ba72395
import sys # for line in sys.stdin: # a = line.split() # print(int(a[0]) + int(a[1])) n = int(input()) list = [] if n == 1: list= [1] elif n == 2: list = [1,1] elif n > 2: list = [1,1] # print(list[0],list[1]) for i in range(2,n): list.append(list[i-1]+list[i-2]) print(list[n-1])