Guest User

Untitled

a guest
Oct 19th, 2017
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.21 KB | None | 0 0
  1. #include <iostream>
  2. #include <functional>
  3.  
  4. int main()
  5. {
  6. std::function<int(int)> fib = [&fib](int n) {return n < 2 ? 1 : fib(n-1) + fib(n-2);};
  7. std::cout << fib(9) << std::endl;
  8. return EXIT_SUCCESS;
  9. }
Add Comment
Please, Sign In to add comment