题解 | #统计每个月兔子的总数#
统计每个月兔子的总数
http://www.nowcoder.com/practice/1221ec77125d4370833fd3ad5ba72395
month = int(input()) def tuzi(month): new_num1 = 1 new_num2 = 0 old_num = 0 for i in range(month-1): old_num += new_num2 new_num2 = 0 new_num2 += new_num1 new_num1 = 0 new_num1 += old_num total_num = new_num1 + new_num2 + old_num return total_num print(tuzi(month))