def fib(n):
    a,b=0,1
    while a<n:
        print(a,end=" ")
        a,b=b,a+b
    print()
    
    
fib(2000)
      

输出:

0 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597 

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-08
猜你喜欢
  • 2021-10-10
  • 2021-10-02
  • 2022-01-21
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案