7-2

#include<stdio.h>

int main(void)

{

         int i;

         int fib[10]={1,1};

         for(i=2;i<=10;i++)

                   fib[i]=fib[i-1]+fib[i-2];

         for(i=0;i<=10;i++){

                   printf("%6d",fib[i]);

                   if((i+1)%5==0)

                            printf("\n");

         }

         return 0;

}

posted @ 2013-10-06 15:28  zhaoyang16  阅读(98)  评论(0编辑  收藏  举报