Home > Software engineering >  Calculate the Fibonacci series, don't know the wrong in where
Calculate the Fibonacci series, don't know the wrong in where

Time:09-30

#include
using namespace std;
Int the Fibonacci (int int f1, f2, int k, int I)
{
Int f3;
F3=f1 + f2;
F1=f2;
F2=f3;
If (i<=k)
{
i++;
Fibonacci (f1, f2, k, I);
}
Return the f3.
}

Int main ()
{
Int k, f3;
Cout<" Input you want to calculate the series "& lt; cin> k;
If (k==1 | | k==2)
F3=1;
The else
F3=Fibonacci (1, 1, k, 3);
Cout<" The resulting value is: ";
Coutreturn 0;
}

CodePudding user response:

The building Lord, you put the c + + code to VB version, is what mean?

Now no c + + test environment, how you try this code:
 int the Fibonacci (int int f1, f2, int k, int I) 
{
Int f3;
F3=f1 + f2;
If (i{
+ + I;
F1=f2;
F2=f3;
Fibonacci (f1, f2, k, I);
}
Return the f3.
}

CodePudding user response:

Fibonacci (f1, f2, k, I); To the f3=Fibonacci (f1, f2, k, I);
  • Related