fork download
  1. #include <stdio.h>//第1講練習フィボナッチ
  2.  
  3. int fibo(int n){
  4. if(n<=1) return 1;
  5. else{
  6. return fibo(n-1)+fibo(n-2);
  7. }
  8. }
  9. int main() {
  10. int x;
  11. x=fibo(4);
  12. printf("x=%d\n",x);
  13. return 0;
  14. }
  15.  
Success #stdin #stdout 0s 5276KB
stdin
Standard input is empty
stdout
x=5