1 1 1 1 1
1 2 2 2 1
1 2 3 2 1
1 2 2 2 1
1 1 1 1 1
维数只能为奇数
int n = 4;
int[,] array = new int[2*n-1, 2*n-1];
for (int i = 1; i < n+1; i++)
{
for (int j = i-1; j < 2*n-i; j++)
for (int k = i - 1; k < 2*n - i; k++)
array[j, k] = i;
}
for (int i = 0; i < 2*n-1; i++)
{
for (int j = 0; j < 2*n-1; j++)
Response.Write(array[i,j]);
Response.Write("<br />");
}