平方矩阵1规律:x = min(min(i,j),min(n-i+1,n-j+1))
#include <iostream>
using namespace std;
int main()
{
int n;
int x;
while(cin >> n , n)
{
for(int i=1;i<=n;i++)
{
for(int j=1;j<=n;j++)
{
x = min(min(i,j),min(n-i+1,n-j+1));
cout<<x<<" ";
}
cout<<endl;
}
cout<<endl;
}
}