#include <stdio.h>
//1,1,2,3,5,8,13这个数列叫斐波那契数列,
//编程实现第N个数的值
int feibonaqie(int n)
{
if(n==1||n==2)
{
return 1;
}
else
{
return feibonaqie(n-2)+feibonaqie(n-1);
}
}
int main(int argc, char *argv[])
{
printf("%d\n",feibonaqie(6));
printf("Hello World!\n");
return 0;
}
斐波那契数列
最新推荐文章于 2022-08-19 00:00:04 发布