回型矩阵
include<stdio.h>
int main()
{int n,m;
scanf("%d",&n);
int a[n][n];
int p=0,q=n-1,count=1;
while(count<=n*n)
{for(int i=p;i<=q;i++)
{a[p][i]=count;
count++;}
for(int i=p+1;i<=q;i++)
{a[i][q]=count;
count++;}
for(int i=q-1;i>=p;i--)
{a[q][i]=count;
count++;}
for(int i=q-1;i>=p+1;i--)
{a[i][p]=count;
count++;}
p++;
q--;
}
for(int i=0;i<n;i++)
{for(int j=0;j<n;j++)
{printf("%d ",a[i][j]);}
printf("\n");}
}