参考文献
C++ 代码
#include<bits/stdc++.h>
using namespace std;
int n,i,j;
int main()
{
while(cin>>n){
if(n==0)break;
for(i=1;i<=n;i++){
for(j=1;j<=n;j++)
cout<<min(min(i,j),min(n-i+1,n-j+1))<<' ';
cout<<endl;
}
cout<<endl;
}
}