fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4.  
  5. long int fib(int n) {
  6. if (n<3)
  7. return 1;
  8. return fib(n-2)+fib(n-1);
  9. }
  10. int main () {
  11. cout<<fib(4)<<" , "<<fib(11)<<endl;
  12. cout<<endl;
  13. return 0;
  14. }
Success #stdin #stdout 0.01s 5312KB
stdin
Standard input is empty
stdout
3 , 89