#include <stdio.h>
int fei(int n)
{
if(n==1||n==2)
return 1;
else
return (fei(n-1)+fei(n-2));
}
int main()
{
int a = 0;
int b = 0;
printf("请输入要输出多少位的斐波那契数列:");
scanf("%d", &a);
for(b=1;b<=a;b++)
{
printf("第%02d位:", b);
printf("%7d", fei(b));
printf("\n");
}
}
11-07
1370
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
08-08