@[garbage2](/user/104380) stO! stO! stO!
by 智子 @ 2020-01-15 14:37:19
@[garbage2](/user/104380) 所以一道橙题您想让它怎么样呢?
by FZzzz @ 2020-01-15 14:55:04
@[function_of_zero](/user/174045) 至少我这种代码不能过**吧**……
by garbage2 @ 2020-01-15 14:57:02
@[garbage2](/user/104380) 嗯……倒也是
by FZzzz @ 2020-01-15 14:58:09
@[function_of_zero](/user/174045) 要不要@[xht37](/user/100544)
by garbage2 @ 2020-01-15 15:20:23
怎么就@出去了呢
by garbage2 @ 2020-01-15 15:20:43
呵呵,这也能过:
```cpp
#include<bits/stdc++.h>
using namespace std;
int a[31][31];
int main(){
int n;
cin>>n;
for(int i=1;i<=n;i++)for(int j=1;j<=n;j++)cin>>a[i][j];//i=x,j=y
for(int i=1;i<=n;i++)for(int j=1;j<=n;j++){
if(i!=1&&i!=n&&j!=1&&j!=n&&a[i][j]==0){
bool x=false,y=false,d=false,f=false;
for(int z=i;z>=1;z--){
if(a[z][j]==1){
x=true;
break;
}
}
for(int z=i;z<=n;z++){
if(a[z][j]==1){
d=true;
break;
}
}
for(int z=j;z>=1;z--){
if(a[i][z]==1){
y=true;
break;
}
}
for(int z=j;z<=n;z++){
if(a[i][z]==1){
f=true;
break;
}
}
if (x&&y&&d&&f){
a[i][j]=2;
}
}
}
for(int i=1;i<=n;i++){
for(int j=1;j<=n;j++)cout<<a[i][j]<<" ";
cout<<endl;
}
}
```
by LZL_train @ 2020-01-21 20:35:17
0 1 1 1 1 1 1 1 1 0
1 0 0 0 0 0 0 0 0 1
1 0 1 1 1 0 0 0 0 1
1 0 1 0 1 0 0 0 0 1
0 1 0 0 1 0 0 0 0 1
0 0 0 0 1 0 0 0 0 1
0 1 1 1 0 0 0 0 0 1
1 0 0 0 0 0 0 0 0 1
0 1 1 1 1 1 1 1 1 0
by LZL_train @ 2020-01-21 20:38:46