Created
January 4, 2014 22:04
-
-
Save Fiona-J-W/8261357 to your computer and use it in GitHub Desktop.
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
#include <iostream> | |
constexpr unsigned long long fib(unsigned n) { | |
return n <= 1 ? 1 : fib(n-1) + fib(n-2); | |
} | |
int main() { | |
auto fib50 = fib(50); | |
std::cout << fib50 << std::endl; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment