/* Program to construct pramid of digits
	  1
	2 3 2
             3 4 5 4 3
          4 5 6 7 6 5 4
*/

#include<stdio.h>
main()
{
	int i,j,m,n;
	clrscr();
	printf("Enter number of rows\n");
	scanf("%d",&n);
	for(i=1;i<=n;i++)
	{
	    for(j=1;j<=n-i;j++)
		printf(" ");
		m=i;
		for(j=1;j<=i;j++)
		  printf("%d",m++);
		    m=m-2;
		 for(j=1;j<=i;j++)
		   printf("%d",m--);
		     printf("\n");
	}
	printf("\n");
	getch();
}