复制代码 代码如下:
#include "stdio.h"
int Feibo(int Num)
{
if(Num == 1 || Num == 2)
{
return 1;
}
else
{
return Feibo(Num - 1) + Feibo(Num - 2);
}
}
void main()
{
int NumIn,i;
scanf("%d", &NumIn);
for(i=1;i<NumIn;i++)
{
printf("%d ",Feibo(i));
}
printf("%d",Feibo(NumIn));
}