找规律,距离边界距离的最小值
C++ 代码
#include<bits/stdc++.h>
using namespace std;
int main(){
int n;
while(cin>>n){
if(n==0)break;
for(int i=1;i<=n;i++){
for(int j=1;j<=n;j++)
cout<<min(min(i,n-i+1),min(j,n-j+1))<<" ";
cout<<endl;
}
cout<<endl;
}
}