你猜我猜不猜你猜不猜

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. scrapy介绍及源码分析

    一 简介 Scrapy基于事件驱动网络框架 Twisted 编写.因此,Scrapy基于并发性考虑由非阻塞(即异步)的实现. 官方文档 :https://docs.scrapy.org/en/late ...

  2. ElasticSearch分词器

    什么是分词器? 分词器,是将用户输入的一段文本,分析成符合逻辑的一种工具.到目前为止呢,分词器没有办法做到完全的符合人们的要求.和我们有关的分词器有英文的和中文的.英文的分词器过程:输入文本-关键词切 ...

  3. calc BZOJ 2655

    calc [问题描述] 一个序列a1,...,an是合法的,当且仅当: 长度为给定的n. a1,...,an都是[1,A]中的整数. a1,...,an互不相等. 一个序列的值定义为它里面所有数的乘积 ...

  4. Ajax && json(原始)

    function findSend() { $.ajax({ // async: false, // cache: true, type: "POST", url: "I ...

  5. (48)C#网络4 web

    WebClient 类 提供用于将数据发送到和接收来自通过 URI 确认的资源数据的常用方法 private delegate string delegatehWeb(); private void ...

  6. 42.QT-QSqlQuery类操作SQLite数据库(创建、查询、删除、修改)详解

    Qt 提供了 QtSql 模块来提供平台独立的基于 SQL 的数据库操作.这里我们所说的“平台 独立”,既包括操作系统平台,也包括各个数据库平台,Qt支持以下几种数据库: QT自带SQLITE数据库, ...

  7. 新闻:融资600万 他用一套系统优化15大HR工作场景 精简入转调离 月开通214家 | IT桔子

    新闻:融资600万 他用一套系统优化15大HR工作场景 精简入转调离 月开通214家 | IT桔子 功劳说不上

  8. spring-quartz定时任务使用小结

    在实际项目中,通常须要用到定时任务(定时作业).spring框架提供了非常好的实现. 1.  下载spring-quartz插件包 这里默认当前系统中是集成了spring框架的基本功能的.去网上下载s ...

  9. struts开发&lt;在eclipse中配置struts. 一&gt;

    1.获取struts的jar包 1.1首先在http://struts.apache.org/download.cgi#struts23163这里下载 struts的文件包(选择struts-2.3. ...

  10. <bgsound> - 背景音乐

    摘要 项目 说明 形式 <bgsound src="..."> 支持 e2+ 标签省略 开始标签:必须,结束标签:无 ■ 说明 bgsound 是 background ...