Commit 4fe354cc by BellCodeEditor

auto save

parent b16f38f3
Showing with 12 additions and 0 deletions
def func(n):
if n <= 2:
return 1
else:
value = func(n-1)+func(n-2)
return value
i = 3
while True:
if func(i) > 100:
print('斐波那契数列的值大于20是第',i,'列,值是',func(12))
break
i+=1
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment