#include <iostream>
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n;
char poly[55][55];
cin>>n;
for(int a=1;a<=n;a++){
for(int b=1;b<=n;b++){
char ch
cin>>ch;
poly[a][b]=ch-'0';
}
}
bool flag=1;
for(int a=1;a<n;a++){
for(int b=1;b<n;b++){
if(poly[a][b]==0)continue;
if(poly[a+1][b]||poly[a][b+1])continue;
flag=0;
break;
}
}
switch(flag){
case 1:cout<<"YES"<<endl;
case 0:cout<<"NO"<<endl;
}
return 0;
}
有一个输出的是YES和NO,怎么了,代码有什么问题???