Problem Description

Welcome to XTCPC! XTCPC start today, you are going to choose a slogan to celebrate it, many people give you some candidate string about the slogan, but the slogan itself must have something relavant to XTCPC, a string is considered relevant to XTCPC if it become
XTCPC after deleting some characters in it. For example, XTCPC, XTCCPCC, OIUXKKJATSADCASPHHC is relevant, XX,FF,GG,CPCXT,XTCP is not. Now you have to write a program to judge whether a string is relevant to XTCPC.

Input

First line an integer t(t≤100), the number of testcases. For each case, there is a string(length≤100, all are uppercase characters).

Output

For each case, output case number first, then "Yes" if the string is relevant, "No" if the string is not relevant. Quote for clarify.

Sample Input

3
XTCPC
CCC
XXXXTTTTCCCCPPPCCC

Sample Output

Case 1: Yes
Case 2: No
Case 3: Yes

签到题,一道字符串的水题。这样的题目还是要争取1A,不要耗费太多的时间;
#include <cstdio>
#include <cstring>
char s[101];
char c[6]={'X','T','C','P','C'};
int main()
{
int t,i,j,id;
scanf("%d",&t);
for(i=1;i<=t;i++)
{
id=0;
scanf("%s",s);
for(j=0;j<strlen(s);j++)
{
if(s[j]==c[id])
id++;
}
if(id==5)
printf("Case %d: Yes\n",i);
else
printf("Case %d: No\n",i);
}
}

XTU OJ 1207 Welcome to XTCPC (字符串签到题)的更多相关文章

  1. 【九度OJ】题目1054:字符串内排序 解题报告

    [九度OJ]题目1054:字符串内排序 解题报告 标签(空格分隔): 九度OJ [LeetCode] http://ac.jobdu.com/problem.php?pid=1054 题目描述: 输入 ...

  2. 【九度OJ】题目1206:字符串连接 解题报告

    [九度OJ]题目1206:字符串连接 解题报告 标签(空格分隔): 九度OJ http://ac.jobdu.com/problem.php?pid=1206 题目描述: 不借用任何字符串库函数实现无 ...

  3. 2016-2017学年第三次测试赛 问题 F: 签到题

    问题 F: 签到题 时间限制: 1 Sec  内存限制: 128 MB提交: 80  解决: 28 提交统计讨论版 题目描述 在计算机网络考试中, 黑帅男神看到一个将IP网络分类的题, 精通C++的他 ...

  4. XC1263 签到题(哇 ,写得我怀疑人生啊!!!@!@)

    1263: 签到题 时间限制: 1 Sec  内存限制: 128 MB提交: 174  解决: 17 标签提交统计讨论版 题目描述 大家刚过完寒假,肯定还没有进入状态,特意出了一道签到题给各位dala ...

  5. 浅谈CVE-2018-12613文件包含/buuojHCTF2018签到题Writeup

    文件包含 蒻姬我最开始接触这个 是一道buuoj的web签到题 进入靶机,查看源代码 <!DOCTYPE html> <html lang="en"> &l ...

  6. 2020KCTF秋季赛签到题

    比赛平台:https://ctf.pediy.com/game-season_fight-158.htm 开场 签到题 例行检查,64位程序,无壳 试运行一下,看看大概的情况 64位ida载入,根据运 ...

  7. A 洛谷 P3601 签到题 [欧拉函数 质因子分解]

    题目背景 这是一道签到题! 建议做题之前仔细阅读数据范围! 题目描述 我们定义一个函数:qiandao(x)为小于等于x的数中与x不互质的数的个数. 这题作为签到题,给出l和r,要求求. 输入输出格式 ...

  8. fjwc2019 D3T1 签到题 (贪心)

    #184. 「2019冬令营提高组」签到题 每次询问接近O(1).......考虑贪心 怎么贪心呢? 对于相邻的两个数,我们要保证异或x后单调不降 我们找到两个数二进制上最高的相异位 当左边的数相异位 ...

  9. CTF-练习平台-WEB之 签到题

    一.签到题 根据提示直接加群在群公告里就能找到~

随机推荐

  1. sublime 的快捷键大全

    Sublime Text 3 快捷键精华版 Ctrl+Shift+P:打开命令面板 Ctrl+P:搜索项目中的文件 Ctrl+G:跳转到第几行 Ctrl+W:关闭当前打开文件 Ctrl+Shift+W ...

  2. SpringBoot + MyBatis(注解版),常用的SQL方法

    一.新建项目及配置 1.1 新建一个SpringBoot项目,并在pom.xml下加入以下代码 <dependency> <groupId>org.mybatis.spring ...

  3. EditPlus 1:更改默认编码方式

    打开软件点击上面的菜单栏Tools(工具),再找到Configure User Tools(用户配置工具)点击,再找到左边栏File点击,这个时候可以看到右边栏的Default encoding点击可 ...

  4. asp.net限制了上传文件大小为..M,解决方法

    asp.net限制了上传文件大小为4M,在:在web.config里加下面一句,加在<System.web></System.web>之间如下:<system.web&g ...

  5. Java基础13一异常

    1.异常概念 异常是程序在运行期发生的不正常的事件,它会打断指令的正常执行流程. 设计良好的程序应该在异常发生时提供处理这些不正常事件的方法,使程序不会因为异常的发生而阻断或产生不可预见的结果. Ja ...

  6. 日期对话框(DatePickerDialog)和时间对话框(TimePickerDialog)

    效果图 布局 <Button android:id="@+id/btn_date" android:text="弹出日期选择对话框" android:la ...

  7. php xss 函数

    function xss($string) { if (is_array($string)||is_object($string)||is_resource($string)) { return '' ...

  8. dispatch_sync:As an optimization, this function invokes the block on the current thread when possible

    两件事情: 1.是否是一个线程: 2.queue task 的目标线程是否有未完成的task. 模型:一个线程处理当前的task还有通过gc d派发来的待执行task. 猜测: 如果目标thread上 ...

  9. Type inference

    Type inference refers to the automatic detection of the data type of an expression in a programming ...

  10. Windows上使用iverilog+gtkwave仿真

    主要参考了: https://www.cnblogs.com/lsgxeva/p/8280662.html 谢谢! ------------------------------------------ ...