这种题不是考思维,就是考你细心程度还有基础知识的,代码如下:

#include <iostream>
#include <string> using namespace std; int main() {
int k;
cin >> k;
string temp;
cin >> temp;
int i = ;
while (temp != "End") {
if (i == k) {
i = -;
cout << temp << endl;
} else if (temp == "ChuiZi") {
cout << "Bu" << endl;
} else if (temp == "JianDao") {
cout << "ChuiZi" << endl;
} else if (temp == "Bu"){
cout << "JianDao" << endl;
}
cin >> temp;
i++;
}
return ;
}

L1-044. 稳赢的更多相关文章

  1. PAT L1-044 稳赢

    https://pintia.cn/problem-sets/994805046380707840/problems/994805086365007872 大家应该都会玩“锤子剪刀布”的游戏:两人同时 ...

  2. 团体程序设计天梯赛-练习集-L1-044. 稳赢

    L1-044. 稳赢 大家应该都会玩“锤子剪刀布”的游戏:两人同时给出手势,胜负规则如图所示: 现要求你编写一个稳赢不输的程序,根据对方的出招,给出对应的赢招.但是!为了不让对方输得太惨,你需要每隔K ...

  3. PAT 天梯赛 L1-044. 稳赢 【循环】

    题目链接 https://www.patest.cn/contests/gplt/L1-044 题意 根据对方给出剪刀石头步 给出对应的胜利出招,每K次 要有一个平局 思路 用一个循环,然后每K次 判 ...

  4. [Swift]LeetCode464. 我能赢吗 | Can I Win

    In the "100 game," two players take turns adding, to a running total, any integer from 1.. ...

  5. PTA L1题目合集(更新至2019.3)

    L1-001 Hello World (5 分) 链接:https://pintia.cn/problem-sets/994805046380707840/problems/9948051471320 ...

  6. 『ACM C++』 PTA 天梯赛练习集L1 | 044-45

    记录今日刷题 ------------------------------------------------L1-044--------------------------------------- ...

  7. Leetcode 464.我能赢吗

    我能赢吗 在 "100 game" 这个游戏中,两名玩家轮流选择从 1 到 10 的任意整数,累计整数和,先使得累计整数和达到 100 的玩家,即为胜者. 如果我们将游戏规则改为 ...

  8. PTA 天梯赛 L1

    L1-002 打印沙漏 细节:就是在  (i>j&&i+j<r+1) 这个区间里才有空格,然后就是 for 循环   for(r=1; ;r+=2)  条件不满足之后还会再 ...

  9. Spring + SpringMVC + Druid + JPA(Hibernate impl) 给你一个稳妥的后端解决方案

    最近手头的工作不太繁重,自己试着倒腾了一套用开源框架组建的 JavaWeb 后端解决方案. 感觉还不错的样子,但实践和项目实战还是有很大的落差,这里只做抛砖引玉之用. 项目 git 地址:https: ...

随机推荐

  1. mysql、oracle分库分表方案之sharding-jdbc使用(非demo示例)

    选择开源核心组件的一个非常重要的考虑通常是社区活跃性,一旦项目团队无法进行自己后续维护和扩展的情况下更是如此. 至于为什么选择sharding-jdbc而不是Mycat,可以参考知乎讨论帖子https ...

  2. 11: python中的轻量级定时任务调度库:schedule

    1.1 schedule 基本使用 1.schedule 介绍 1. 提到定时任务调度的时候,相信很多人会想到芹菜celery,要么就写个脚本塞到crontab中. 2. 不过,一个小的定时脚本,要用 ...

  3. Android之xml解析

    利用类下载器解析Xml文件要解析的xml文件<?xml version="1.0" encoding="utf-8"?><info> & ...

  4. Codeforces 866C Gotta Go Fast - 动态规划 - 概率与期望 - 二分答案

    You're trying to set the record on your favorite video game. The game consists of N levels, which mu ...

  5. selenium css定位方式

  6. 查看Windows系统信息

    在终端输入"msinfo32". ms>Microsoft info>information

  7. topcoder srm 455 div1

    problem1 link 令$f[x1][y1][x2][y2]$表示矩形(x1,y1)(x2,y2)中能选出的最大值.dp即可. problem2 link 这个题应该有更好的递推公式. 我的做法 ...

  8. Python3 tkinter基础 Entry show textvariable 密码输入框

             Python : 3.7.0          OS : Ubuntu 18.04.1 LTS         IDE : PyCharm 2018.2.4       Conda ...

  9. fedora23 桌面工具栏fedy, 桌面美化 allow: 2'lau不是2'l2u

    ## Sudoers allows particular users to run various commands as ## the root user, without needing the ...

  10. SpringBoot 利用过滤器Filter修改请求url地址

    要求: 代码中配置的url路径为http://127.0.0.1/api/associates/queryAssociatesInfo 现在要求http://127.0.0.1/associates/ ...