求:斐波那契数列的第n项

def he (n):
if n < 3 :
return 1
return he(n-1)+he(n-2)
print(he(n))

猜你喜欢

转载自www.cnblogs.com/lzw19951020/p/9362998.html