色婷婷狠狠18禁久久YY,CHINESE性内射高清国产,国产女人18毛片水真多1,国产AV在线观看

求斐波那契數列的前15項

林國瑞2年前28瀏覽0評論

求斐波那契數列的前15項?

#include<stdio.h>

int main()

{

int n,i,un1,un2,un;

for(n=2;n<3;)

{

printf("please enter required number of generation:");

scanf("%d",&n);

if(n<3) printf("\n enter error!\n"); /*控制輸入正確的n值*/

}

un=un2=1;

printf("the repid increase of rabbits in first %d generation is as felow:\n",n);

printf("l\tl\t");

for(i=3;i<=n;i++)

{

un1=un2;

un2=un;

un=un1+un2; /*利用通項公式求解n項的值*/

printf(i%10?"%d\t":"%d\n",un);

}

printf("\n");

}