题解 | #兔子的数量#
兔子的数量
https://www.nowcoder.com/practice/8783056676de4396b0bf816a3561d62f
def f(x): if x == 1: return 2 elif x == 2: return 3 else: return f(x-1) + f(x-2) i = int(input()) print(f(i))
兔子的数量
https://www.nowcoder.com/practice/8783056676de4396b0bf816a3561d62f
def f(x): if x == 1: return 2 elif x == 2: return 3 else: return f(x-1) + f(x-2) i = int(input()) print(f(i))
相关推荐