#include <stdio.h>
int F(int n)
{
if (n == 1 || n == 2) //递归出口
{
return 1;
}
else
{
return F(n-1) + F(n-2);
}
}
int main()
{
int n;
printf("please input the nth nu :");
scanf("%d",&n); //输入要输出的数字是第n个
printf("the nth nu is %d\n",F(n));
return 0;
}
int F(int n)
{
if (n == 1 || n == 2) //递归出口
{
return 1;
}
else
{
return F(n-1) + F(n-2);
}
}
int main()
{
int n;
printf("please input the nth nu :");
scanf("%d",&n); //输入要输出的数字是第n个
printf("the nth nu is %d\n",F(n));
return 0;
}