fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. long int fib(int n) {
  5. if (n < 3)
  6. return 1;
  7. return fib(n - 1) + fib(n - 2);
  8. }
  9. int main( ) {
  10. cout << fib(32) << endl;
  11. cout << fib(40) << endl;
  12. cout << fib(46) << endl;
  13. return 0;
  14. }
Success #stdin #stdout 3.61s 5280KB
stdin
Standard input is empty
stdout
2178309
102334155
1836311903