这是我的代码,我一编译运行就连输入都没法输入,这是为啥?
#include <iostream>
using namespace std;
int main(){
int n;
int b[n][2];
int a[n][n],cx,cy,mid;
while (true){
cin>>n;
if (n==0) break;
for (int i=0;i<=n/2;i++){
for (int j=0;j<2;j++){
b[i][j]=i*(j+1);
}
}
if (n%2==0){
cx=n/2-1,cy=n/2-1;
mid=n/2;
}
else{
cx=n/2,cy/2;
mid=(n+1)/2;
}
for (int i=0;i<=n/2;i++){
for(int j=0;j<=n/2;j++){
int d=abs(i-cx)+abs(j-cy);
for (int k=0;k<=n/2;k++){
if (d>=b[k][0]&&d<=b[k][1]){
a[i][j]=mid-k;
a[i][n-1-j]=a[i][j];
a[n-1-i][j]=a[i][j];
}
}
}
}
for (int i=0;i<n;i++){
for (int j=0;j<n;j++){
cout<<a[i][j]<<" ";
}
cout<<endl;
}
}
return 0;}