def feibonaqi(num:int):
result = []
for i in range(1,num+1):
if i == 1 or i == 2:
result.append(1)
else:
result.append(result[i-2]+result[i-3])
return result
斐波那契数列+pyton
最新推荐文章于 2024-06-04 12:54:37 发布