题解 | #斐波那契数列#
斐波那契数列
https://www.nowcoder.com/practice/c6c7742f5ba7442aada113136ddea0c3
int Fibonacci(int n ) {
// write code here
if(1 == n)
{
return 1;
}
else if(2 == n)
{
return 1;
}
else
{
return Fibonacci(n-1)+Fibonacci(n-2);
}
}
// write code here
if(1 == n)
{
return 1;
}
else if(2 == n)
{
return 1;
}
else
{
return Fibonacci(n-1)+Fibonacci(n-2);
}
}