请问c哪错了。。。
#include<bits/stdc++.h>
using namespace std;
int main(){
int n,x=0,y=0;
string str;
bool flag=0;
cin>>n;
while(n--){
cin>>str;
for(int i=0;i<str.size();i++)
if(str[i]=='N'||str[i]=='n')
x++;
else if(str[i]=='Y'||str[i]=='y')
y++;
}
if(x>=str.size()/2)
cout<<"pmznb";
else flag=1;
if(y>=str.size()/2)
cout<<"lyrnb";
else flag=1;
if(x==y==str.size()/2)
cout<< "pmznb"<<"lyrnb";
if(flag=2) cout<<"wsdd";
return 0;
}
using namespace std;
int main(){
int n,x=0,y=0;
string str;
bool flag=0;
cin>>n;
while(n--){
cin>>str;
for(int i=0;i<str.size();i++)
if(str[i]=='N'||str[i]=='n')
x++;
else if(str[i]=='Y'||str[i]=='y')
y++;
}
if(x>=str.size()/2)
cout<<"pmznb";
else flag=1;
if(y>=str.size()/2)
cout<<"lyrnb";
else flag=1;
if(x==y==str.size()/2)
cout<< "pmznb"<<"lyrnb";
if(flag=2) cout<<"wsdd";
return 0;
}