#includeint main(){int i,j,k,base=1,n;int a[10][10]={1};printf("请输入矩阵阶数:");scanf("%d",&n);for(k=0;k<=n/2;k++){for(i=k;i<=n-1-k;i++) //行不变,列++ !!有个‘=’a[k][i] = base++; for(j=k+1;jk;i--) //行不变,列--a[n-1-k][i] = base++;for(j=n-1-k;j>k;j--) //列不变,行--a[j][k] = base++;}if(n%2==0)a[(n-1)/2][(n-1)/2] = base;for(i=0;i