斐波那契数列:1.递归法
#include <stdio.h>
int fib(int m)
{
if(m>=3)
{
return fib(m-1)+fib(m-2);
}
else
{
return 1;
}
}
int main()
{
int n;
scanf("%d",&n);
printf("%d",fib(n));
return 0;
}
标签:fib,return,数列,int,斐波,那契
From: https://www.cnblogs.com/yesiming/p/17441626.html