#include <stdio.h>
#include <string.h>
int fbnq(int a);
int main(int argc, const char *argv[])
{
int i;
for(i=1;i<=9;i++)
{
printf("%d\t",fbnq(i));
}
putchar(10);
return 0;
}
int fbnq(int a)
{
if(a==1||a==2)
{
return 1;
}
else
{
return fbnq(a-1)+fbnq(a-2);
}
}
这篇文章详细介绍了C语言中名为fbnq的递归函数,它通过基础条件(a=1或a=2)和递归调用来计算序列值。函数展示了递归在编程中的应用。
8万+

被折叠的 条评论
为什么被折叠?



