你猜我猜不猜你猜不猜

Time Limit: 2000ms   Memory limit: 65536K  有疑问?点这里^_^

题目描述

In the past 39th annual ACM international collegiate programming contest in Beijing station in Asia that Triple_S sent by our school team won the SDUT in Reginal bronze 11. At the same time,the team’s name is cray which is to let the host after reading the wrong three times, still missed a word to read. But  zhuhu gave a high evaluation to the team.
 
As the creator of this team, I want to say is,  in fact I was reminded of a game which is named ”ni cai wo cai bu cai ni cai bu cai wo cai bu cai”, may be the teacher didn\'t remember it. The name is just due to a conversation with a girl, so the origin is simple.
 
A:Why are you so diao?
 
B:Ni cai.
 
A:Ni cai wo cai bu cai.
 
B:Ni cai wo cai bu cai ni cai bu cai.
 
A:Ni cai wo cai bu cai ni cai bu cai wo cai bu cai.
 
Then do you know the content of their first conversation X?OK,in order to avoid the mle , RE professionals will popularize related knowledge for you . Please seize this chance!
 
The operation is very simple, only need to output the first letter of each word .For example , You can substitute N for Ni . Next, I\'ll demonstrate specific operation steps

输入

 For everytestcase, each line of input a Character , said A or B.

Then enter an Integer X (0<=X<=10^5), said the figure’s the first  X words.

输出

 Output the words.

示例输入

A 2
A 3
B 3

示例输出

Ncwcbc
Ncwcbcncbcwcbc
Ncwcbcncbcwcbcncbc 代码:1Y
#include <iostream>
#include <string>
#include <algorithm> using namespace std; int main()
{
char ch;
int n;
int i, j; while(cin>>ch>>n)
{
if(ch=='A')
{
if(n==1)
{
cout<<"Waysd\n";
continue;
}
else if(n==2)
{
cout<<"Ncwcbc\n";
continue;
}
else
{
cout<<"Ncwcbc";
for(i=0; i<n-2; i++)
{
cout<<"ncbcwcbc";
}
cout<<endl;
continue;
}
}
else if(ch=='B')
{
if(n==1)
{
cout<<"Nc\n";
continue;
}
else if(n==2)
{
cout<<"Ncwcbcncbc\n";
continue;
}
else
{
cout<<"Ncwcbcncbc";
for(j=0; j<n-2; j++)
{
cout<<"wcbcncbc";
}
cout<<endl;
continue;
}
}
}
return 0;
}

SDUT 3035 你猜我猜不猜你猜不猜(字符串 规律性)的更多相关文章

  1. {python}完成完整的温度转换程序 猜数字游戏(猜价格,猜年龄等) 解析身份证号、学号不同片段的含义

    完成完整的温度转换程序 while True: a = int(input("如果是华氏转摄氏,请按1\n,如果是摄氏转华氏,请按2\n")) if a==1: h = float ...

  2. 猜随机数(控制台输入,字符串转int)

    package com.hanqi.suijishu; import java .util.Random; // main方法类 专门用来运行方法 public class Main { public ...

  3. C语言猜数字游戏

    猜数字游戏,各式各样的实现方式,我这边提供一个实现方式,希望可以帮到新手. 老程序猿就不要看了,黑呵呵 源代码1 include stdio.h include stdlib.h include ti ...

  4. 不一样的猜数字游戏 — leetcode 375. Guess Number Higher or Lower II

    好久没切 leetcode 的题了,静下心来切了道,这道题比较有意思,和大家分享下. 我把它叫做 "不一样的猜数字游戏",我们先来看看传统的猜数字游戏,Guess Number H ...

  5. pyqt5猜数游戏

    电脑随机生成4个互不相等的数,你猜. 1:你猜的数和正确答案相比,位置正确的个数 2:你猜的数虽然在正确答案中,但位置不对,它的个数. 代码如下: #!/usr/bin/env python # -* ...

  6. while循环小练习-猜答案

    条件 1.每个用户只能猜10次产品的价格2.每次猜玩价格,提示用户价格是多了还是少了或者对了3.如果用户才对则终止程序执行 break! i = 0 #设置一个次数变量 price = 38 #设置一 ...

  7. 详解 leetcode 猜数字大小 II

    375. 猜数字大小 II 原题链接375. 猜数字大小 II 题目下方给出了几个提示: 游戏的最佳策略是减少最大损失,这引出了 Minimax 算法,见这里,和这里 使用较小的数开始(例如3),看看 ...

  8. python猜数字(多种实现方法)

    设定一个理想数字比如:66,让用户输入数字,如果比66⼤,则显示猜测的结果⼤了:如果比66⼩,则显示猜测的结果小了;只有等于66,显示猜测结果 第一种方式(最简单的方式实现) n = 66 # 理想数 ...

  9. java实现登录的验证码和猜数字游戏_图形化界面

    实验任务四 1,出现设计思想 (1)先定义文本框.密码框和验证码框的组件 (2)定义面板和按钮的个数 (3)定义公有的虚构方法,通过对象实例化来调用 (4)利用Random类来实现生成0-9的随机数 ...

随机推荐

  1. Spoj-NPC2015A Eefun Guessing Words

    Eefun Guessing Words Eefun is currently learning to read. His way of learning  is unique, by trying ...

  2. Nk 1430 Divisors(因子数与质因数)

    Time Limit: 5000 ms    Memory Limit: 10000 kB   Total Submit : 432 (78 users)   Accepted Submit : 10 ...

  3. Android Studio升级到3.0,抛出Aapt2Exception异常

    android studiao错误: Android resource linking failedOutput: D:\_ASWorkSpace\phone_new\app\src\main\res ...

  4. go初识

    for循环 ; i < ; i++ { fmt.Println(i*i) } ls := "agd" for _, arg := range ls{ fmt.Println( ...

  5. django学习之- simple_tag

    如何将前端的数据直接通过python模块进行渲染,使用django的simple_tag功能,如下 django后端编写: 1:在对应的app目录下创建目录:templatetags 2:在templ ...

  6. 洛谷——P2074 危险区域

    P2074 危险区域 题目背景 一个恐怖组织在一座城市中安放了定时炸弹,其威力巨大,现在这里的警长想知道最坏的情况下会有多少街区受威胁. 题目描述 在一个城市有N*M个街区,每个街区由坐标描述,如图所 ...

  7. KS103超声波测距模块

    max232:电平转换芯片,将电脑的RS-232标准串口(高+12V,低-12V)转换为(高+5V,低0V). 电脑串口(RS -232) => 单片机串口(TTL串口) SIPEX SP323 ...

  8. codechef Tree and Queries Solved

    题目链接: https://www.codechef.com/problems/IITK1P10 大概是:修改点值,求子树节点为0有多少个, DFS序后,BIT 询问,修改 ;    {        ...

  9. 洛谷 P4318 完全平方数

    题目描述 小 X 自幼就很喜欢数.但奇怪的是,他十分讨厌完全平方数.他觉得这些数看起来很令人难受.由此,他也讨厌所有是完全平方数的正整数倍的数.然而这丝毫不影响他对其他数的热爱. 这天是小X的生日,小 ...

  10. 数字巨头们的表态--<大佬与大话>

    作者魏武挥 类别非虚构 / 中篇 本书为作者为<21世纪商业评论>的专栏文章合集,共20篇,算是第一卷吧,后期还会写下去.这个专栏的名字叫<大佬与大话>,专门收集TMT圈子商业 ...