Skip to content

Instantly share code, notes, and snippets.

@Nick0603
Created July 29, 2017 15:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Nick0603/18ccf6be963f5559409a347d15a410e0 to your computer and use it in GitHub Desktop.
Save Nick0603/18ccf6be963f5559409a347d15a410e0 to your computer and use it in GitHub Desktop.
def fibonacci(n):
if n == 1:
return 1
elif n == 2:
return 2
else:
return fibonacci(n-2) + fibonacci(n-1)
ans = fibonacci(50)
print("十階總共有 %d 種可能的走法"%ans)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment