#include <stdio.h>
#define M 5
//行数
#define N (2*M)
void main()
{
int a[M][N]={0};
for (int row = M-1; row >= 0; row--)
{
for (int column_1 = M, column_2 = M; column_1 >= M - row; column_1--, column_2++)
{
a[row][column_1] = row + 1;
a[row][column_2] = row + 1;
}
}
for ( row = 0; row < M; row++)
{
for (int column = 0; column < N; column++)
{
if (a[row][column] == 0)printf(" ");
else printf("%d", a[row][column]);
}
printf("\n");
}
}
1
222
33333
4444444
555555555
66666666666
7777777777777
888888888888888
99999999999999999