fork(1) download
  1. #include <stdio.h>
  2. int fib()
  3. {
  4. int x;
  5. if(x==0)
  6. return 0;
  7. else if(x==1)
  8. return 1;
  9. else
  10. return fib(x-1)+fib(x-2);
  11. }
  12.  
  13. int main(void) {
  14. int n;
  15. scanf("%d",&n);
  16. printf("%d",fib(n));
  17. return 0;
  18. }
  19.  
Success #stdin #stdout 0s 5320KB
stdin
6
stdout
Standard output is empty