题解 | #Fibonacci#
Fibonacci
https://www.nowcoder.com/practice/17ad6908e36a49f4b06ea96936e8bb25
def cal_num(n): if n == 0: return 0 elif n == 1: return 1 else: return cal_num(n-1)+cal_num(n-2) num = eval(input()) print(cal_num(num))
Fibonacci
https://www.nowcoder.com/practice/17ad6908e36a49f4b06ea96936e8bb25
def cal_num(n): if n == 0: return 0 elif n == 1: return 1 else: return cal_num(n-1)+cal_num(n-2) num = eval(input()) print(cal_num(num))
相关推荐