Open Source Your Knowledge, Become a Contributor
Technology knowledge has to be shared and made accessible for free. Join the movement.
Welcome!
This C++ template lets you get started quickly with a simple one-page playground.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include <functional>
#include <iostream>
int main() {
const std::function<std::size_t (const std::size_t)> f_fib = [&f_fib](const std::size_t v) {
if (v <= 1)
return v;
return f_fib(v - 2) + f_fib(v - 1);
};
std::cout << f_fib(25); // 75025
}
Enter to Rename, Shift+Enter to Preview
Advanced usage
If you want a more complex example (external libraries, viewers...), use the Advanced C++ template
Open Source Your Knowledge: become a Contributor and help others learn. Create New Content