//斐波那契数列
//代码可直接运行
#include <stdio.h>
int main()
{
int a,b,i,j,n;
i=1;
j=1;
printf(“请输入一个数:”);
scanf("%d",&n);
printf("%5d\n%5d\n",i,j);
for(b=3;b<=n;b++)
{
a=i+j;
i=j;
j=a;
printf("%5d\n",a);
}
return 0;
}
//斐波那契数列
//代码可直接运行
#include <stdio.h>
int main()
{
int a,b,i,j,n;
i=1;
j=1;
printf(“请输入一个数:”);
scanf("%d",&n);
printf("%5d\n%5d\n",i,j);
for(b=3;b<=n;b++)
{
a=i+j;
i=j;
j=a;
printf("%5d\n",a);
}
return 0;
}