Created
May 2, 2022 11:31
-
-
Save tuanpmt/9bd292ee6ac8b2b9526e8515fe62d590 to your computer and use it in GitHub Desktop.
fib
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int fib(int n) | |
{ | |
if (n < 2) return n; | |
else { | |
int x = fib(n - 1); | |
int y = fib(n - 2); | |
return x + y; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment