```cpp
include[HTML_REMOVED]
using namespace std;
long long a[1010][1010];
int main(){
int h,l;
cin>>h>>l;
int left=0,right=l-1,up=0,bottom=h-1,k=1;
while(left<=right&&up<=bottom){
for(int i=left;i<=right&&up<=bottom;i){
a[up][i]=k;
k;
}
up;
for(int i=up;i<=bottom&&left<=right;i){
a[i][right]=k;
}
right–;
for(int i=right;i>=left&&up<=bottom;i–){
a[bottom][i]=k;
}
bottom–;
for(int i=bottom;i>=up&&left<=right;i–){
a[i][left]=k;
}
left;
}
for(int i=0;i<h;i){
for(int j=0;j<l;j){
printf(“%d “,a[i][j]);
}
printf(“\n”);
}
//多余,多换一行 printf(“\n”);
return 0;
}