fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. unsigned long long fib(unsigned p,bool show)
  5. {
  6. unsigned long long result=p<2?p:fib(p-1,show)+fib(p-2,false);
  7. if(show)cout<<result<<endl;
  8. return result;
  9. }
  10.  
  11. int main()
  12. {
  13. fib(13,true);
  14. return 0;
  15. }
Success #stdin #stdout 0s 4524KB
stdin
Standard input is empty
stdout
1
1
2
3
5
8
13
21
34
55
89
144
233