def fib(n): a, b = 1, 1 while a < n: print(a, end=‘ ‘) a, b = b, a + b fib(100000) #输出结果 #1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597 2584 4181 6765 10946 17711 28657 46368 75025
原文地址:https://www.cnblogs.com/chuangming/p/8480579.html
时间: 2024-10-09 12:58:00