5-5

#include<stdio.h>

int main(void)

{

         void pyramid(int n);

 

         pyramid(5);

 

         return 0;

}

void pyramid(int n)

{

         int i,j;

 

         for(i=1;i<=n;i++){

                   for(j=1;j<=i;j++)

                            printf(" ");

                   for(j=1;j<=i;j++)

                            printf("%d",i);

                   putchar('\n');

         }

}

posted @ 2013-10-04 18:47  zhaoyang16  阅读(120)  评论(0编辑  收藏  举报