L1-044 稳赢
题目 L1-044 稳赢
思路分析
代码实现
#include<bits/stdc++.h>
using namespace std;
#define endl '\n'
#define int long long
using ll = long long;
using ull = unsigned long long;
using PII = pair<int,int>;
using Pll = pair<ll,ll>;
int dx[4]={-1,0,1,0},dy[4]={0,1,0,-1};
const int inf = 0x3f3f3f3f;
signed main()
{
ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
int k;cin>>k;
string s;
int cnt=0;
while(cin>>s){
cnt++;
if(s=="End") break;
if(cnt%(k+1)==0){
if(s=="ChuiZi") cout<<"ChuiZi"<<endl;
if(s=="JianDao") cout<<"JianDao"<<endl;
if(s=="Bu") cout<<"Bu"<<endl;
}else{
if(s=="ChuiZi") cout<<"Bu"<<endl;
if(s=="JianDao") cout<<"ChuiZi"<<endl;
if(s=="Bu") cout<<"JianDao"<<endl;
}
}
return 0;
}
同类题型
视频讲解
⬅️ L1-043 阅览室 🏠 00-天梯赛 ➡️ L1-045 宇宙无敌大招呼
💬 评论