L1-044 穩贏 分數 15.cpp

Frodnx發表於2024-08-05
// 5'33"
#include <iostream>
using namespace std;
int main()
{
    int k;
    cin >> k;
    string s;
    int cnt = 1;
    while(cin >> s)
    {
        if(s == "End") break;
        if((cnt % (k + 1)) == 0)
        {
            cout << s;
        }
        else
        {
            if(s == "JianDao") cout << "ChuiZi";
            else if(s == "ChuiZi") cout << "Bu";
            else if(s == "Bu") cout << "JianDao";
        }
        cout << endl;
        ++ cnt;
    }
    return 0;
}

相關文章