#include <stdlib.h>
#include <stdio.h>
int fib(int n)
{
while (n==1||n==2)
return 1;
return fib(n-1)+fib(n-2);
}
int main ()
{
int n;
scanf("%d",&n);
printf("%d\n,fib(n));
return 0;
}
递归法求斐波那契数列
猜你喜欢
转载自blog.csdn.net/qq_44840046/article/details/89431386
今日推荐
周排行