Created
May 31, 2017 15:36
-
-
Save njlr/85de63c30ce3ff330193719a3e3250b2 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
constexpr unsigned fibonacci(const unsigned x) { | |
return x <= 1 ? | |
1 : | |
fibonacci(x - 1) + fibonacci(x - 2); | |
} | |
int main() { | |
return fibonacci(5); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment