题解 | #兔子的数量#
兔子的数量
https://www.nowcoder.com/practice/8783056676de4396b0bf816a3561d62f
x1 = 2 x2 = 3 y = int(input()) if(y == 1): print(x1) elif(y == 2): print(x2) else: for i in range(y - 2): a = x1 + x2 x1 = x2 x2 = a print(a)
兔子的数量
https://www.nowcoder.com/practice/8783056676de4396b0bf816a3561d62f
x1 = 2 x2 = 3 y = int(input()) if(y == 1): print(x1) elif(y == 2): print(x2) else: for i in range(y - 2): a = x1 + x2 x1 = x2 x2 = a print(a)
相关推荐