竞赛讨论区 > 请问c哪错了。。。
头像
💰201910081644623
发布于 2019-12-08 23:41
+ 关注

请问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;
}

全部评论

(2) 回帖
加载中...
话题 回帖

等你来战

查看全部

热门推荐