#include <stdio.h>
#include <stdlib.h>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
int main(int argc, char *argv[]) {
int shu1=1,shu2=1,i,n;
printf("请输入数列位数的一半:");
scanf("%d",&n);
printf("1\n1\n");
for(i=0;i<n-1;i++)
{
shu1=shu1+shu2;
shu2=shu1+shu2;
printf("%d\n%d\n",shu1,shu2);
}
return 0;
}
fibonacci数列计算
最新推荐文章于 2020-11-20 12:40:01 发布