티스토리 뷰

#include <stdio.h>

int Fibo(int N){


printf("Func call param %d\n", N);


if(N == 0){


return 0;

}


else if(N == 1){


return 1;

}


else{


return Fibo(N - 1) + Fibo(N - 2);

}


}


int main(void){


Fibo(7);

return 0;

}


OUTPUT

Func call param 7
Func call param 6
Func call param 5
Func call param 4
Func call param 3
Func call param 2
Func call param 1
Func call param 0
Func call param 1
Func call param 2
Func call param 1
Func call param 0
Func call param 3
Func call param 2
Func call param 1
Func call param 0
Func call param 1
Func call param 4
Func call param 3
Func call param 2
Func call param 1
Func call param 0
Func call param 1
Func call param 2
Func call param 1
Func call param 0
Func call param 5
Func call param 4
Func call param 3
Func call param 2
Func call param 1
Func call param 0
Func call param 1
Func call param 2
Func call param 1
Func call param 0
Func call param 3
Func call param 2
Func call param 1
Func call param 0
Func call param 1


댓글
댓글쓰기 폼