题解 | #统计每个月兔子的总数#
统计每个月兔子的总数
http://www.nowcoder.com/practice/1221ec77125d4370833fd3ad5ba72395
| 月份/总数 | 能生产的兔子数 |
|---|
| 3/2 | 1 |
|---|
| 4/3 | 1 |
|---|
| 5/5 | 2 |
|---|
| 6/8 | 3 |
|---|
| 7/13 | 5 |
|---|
| 8/21 | 8 |
|---|
| 9/33 | 11 |
|---|
| .../... | ... |
|---|
| t / n_t | m_t |
|---|---|
| t+1 / n_t+m_t+1 =2*n_t-m_t | n_t-m_t |
n = int(input())
start=1
res=1
if n>2:
for i in range(2,n):
res+=start
start=res-start
print(res)
