Home > Back-end > C the Fibonacci sequence, fails to solve
C the Fibonacci sequence, fails to solve
Time:10-25
As shown in figure, there is no error, only to generate failure, this is how the
The code # include & lt; stdio.h> Int fun (int n); The main () { Int I, n=0; The scanf (" % d ", & amp; n); for (i=0; iPrintf (" % d ", fun (I)); } Int fun (int n) { If (n==0) return 0; Else if (n==1) return 1; The else return fun(n-1)+fun(n-2); }
CodePudding user response:
Main function with integer or empty type operation is int main (), or void main ()