稳赢,执行一个之后就停止了

img


#include <iostream>
#include <string>
using namespace std;
int main(){
    int K,count=0;
    cin>>K;
    string s;
    for(int i=0;;i++)
    {
        cin>>s;
        count++;
        if(s=="ChuiZi"){
            if(count<K)
            {
                cout<<"Bu"<<endl;
            }
            if(count==K)
            {
                cout<<s<<endl;
            }
        }
        if(s=="JianDao")
        {
            if(count<K)
            {
                cout<<"ChuiZi"<<endl;
            }
            if(count==K)
            {
                cout<<s<<endl;
            }
        }
        if(s=="Bu")
        {
            if(count<=K)
            {
                cout<<"JianDao"<<endl;
                count++;
            }
            if(count==K)
            {
                cout<<s<<endl;
            }
        }
        if(s=="End")
        {
            break;
        }
    }
        return 0;
}

代码执行一个之后就停止了,不会再继续执行,是为什么?求解

供参考:

#include <iostream>
#include <string>
using namespace std;
int main(){
    int K,count=0;
    cin>>K;
    string s;
    for(int i=0;;i++)
    {
        cin>>s;
        count++;
        if(s=="ChuiZi")
        {
            if(count<K)
            {
                cout<<"Bu"<<endl;
            }
            if(count==K)
            {
                cout<<s<<endl;
                count=0;
            }
        }
        if(s=="JianDao")
        {
            if(count<K)
            {
                cout<<"ChuiZi"<<endl;
            }
            if(count==K)
            {
                cout<<s<<endl;
                count=0;
            }
        }
        if(s=="Bu")
        {
            if(count<K) //if(count<=K)
            {
                cout<<"JianDao"<<endl;
                        //count++;
            }
            if(count==K)
            {
                cout<<s<<endl;
                count=0;
            }
        }
        if(s=="End")
        {
            break;
        }
    }
    return 0;
}

要我重写一个给你吗?

如果能帮忙看一下我的代码哪里有错误就更加感谢了!