A. HQ9+
time limit per test2 seconds
memory limit per test256 megabytes
inputstandard input
outputstandard output

HQ9+ is a joke programming language which has only four one-character instructions:

“H” prints “Hello, World!”,
“Q” prints the source code of the program itself,
“9” prints the lyrics of “99 Bottles of Beer” song,
“+” increments the value stored in the internal accumulator.
Instructions “H” and “Q” are case-sensitive and must be uppercase. The characters of the program which are not instructions are ignored.

You are given a program written in HQ9+. You have to figure out whether executing this program will produce any output.

Input
The input will consist of a single line p which will give a program in HQ9+. String p will contain between 1 and 100 characters, inclusive. ASCII-code of each character of p will be between 33 (exclamation mark) and 126 (tilde), inclusive.

Output
Output “YES”, if executing the program will produce any output, and “NO” otherwise.

Examples
input
Hi!
output
YES
input
Codeforces
output
NO

Note
In the first case the program contains only one instruction — “H”, which prints “Hello, World!”.

In the second case none of the program characters are language instructions.

#include<stdio.h>
int main()
{char str;while(str!='\n'){scanf("%c",&str);if(str=='H'||str=='Q'||str=='9'){printf("YES\n");return 0;}}printf("NO\n");return 0;
}

Problem--133A--Codeforces--A. HQ9+相关推荐

  1. Problem - 1335E2 - Codeforces(暴力+优化)

    Problem - 1335E2 - Codeforces 题目大意: 给定你长度为nnn的序列,让你将其分成三个子序列,满足如下关系[a,...,a⏟x,b,...,b⏟y,a,...,a⏟x][\ ...

  2. Codeforces Problem-133A HQ9+

    Codeforces Problem-133A HQ9+ 基本思想:   本题比较坑,字符串中含有'H'.'Q'.'9'字符即满足要求,'+'是个迷惑项,不需要判断. AC代码: #include & ...

  3. Problem - 1190B - Codeforces(分类讨论博弈)

    Problem - 1190B - Codeforces 题目大意:有nnn堆石子,每堆的数目为aia_iai​,现在Alice和Bob两个人可以移走任意一堆不为空的石子中的一颗石子,如果某人移动完石 ...

  4. Codeforces Round #439 (Div. 2) Problem C (Codeforces 869C) - 组合数学

    - This is not playing but duty as allies of justice, Nii-chan! - Not allies but justice itself, Onii ...

  5. Codeforces Round #628 (Div. 2) E. Ehab‘s REAL Number Theory Problem 巧妙的质因子建图

    传送门 文章目录 题意: 思路: 题意: 给你nnn个数,每个数的因子个数不超过777个,选出最少的数使其乘积为平方数. n≤1e5n\le 1e5n≤1e5 思路: 由于因子不超过777个,所以由约 ...

  6. Codeforces Round #770 (Div. 2) Problem B.Fortune Telling

    题意: 给定两个数,Alice的数x, Bob的数 x + 3,和一个长度为n的数组a,x和x + 3都要和a的每一个数执行 "加法" 或 "异或" 两个操作的 ...

  7. 【Codeforces】A3组刷题记录( 43 / 43 )

    目录 A1. Combination Lock A2. Summer Camp rzt A3. Soft Drinking ★A4. Coder ★A5. GukiZ and Contest ★A6. ...

  8. Codeforces Round #712 Div.2(A ~ F) 超高质量题解(每日训练 Day.15 )

    整理的算法模板合集: ACM模板 点我看算法全家桶系列!!! 实际上是一个全新的精炼模板整合计划 Codeforces Round #712 Div.2(A ~ F) 题解 比赛链接:https:// ...

  9. Codeforces Round #828 (Div. 3) E1. Divisible Numbers (easy version) 解题报告

    原题链接: Problem - E1 - Codeforces 题目描述: This is an easy version of the problem. The only difference be ...

  10. Codeforces Global Round 21 E. Placing Jinas

    Problem - E - Codeforces (Unofficial mirror by Menci) E. Placing Jinas 题目大意:每个点相当于(0,0)到每个点(只能向下和向右走 ...

最新文章

  1. SiteMapPath基本用法
  2. linux驱动 pcie 框架_Linux PCI 设备驱动基本框架(二)
  3. 2011年 CIO简历该怎么写?
  4. apache hive 使用概述
  5. Qt 断言的使用 Q_ASSERT
  6. 显示行数 设置ssh终端_linux限制用户登陆的一些方法
  7. python sublime 提示补全_【原创】Sublime+Verilator建立强大的verilog编写环境
  8. 最短路dijkstra算法详解_图论系列开始填坑--Dijkstra,单源最短路
  9. Arduino连接GPS模块
  10. AMBA_AXI总线详解
  11. 对称密钥和非对称密钥有什么区别,区别在哪里
  12. 一些常用外设DHT11,sg90
  13. 计算机学报范文,计算机学报论文
  14. bitset java 源码_【JAVA】BitSet的源码研究
  15. LOAP引擎:clickhouse06:简单介绍几个JSON函数
  16. 【IOS】模仿抽屉新热榜动态启动页YFSplashScreen
  17. 单目标跟踪算法调研(2020)
  18. lucene6.6+拼音分词+ik分词实现
  19. iOS创建framework静态库(SDK组件化)
  20. webRTC(十):webrtc 实现web端对端视频

热门文章

  1. jsjquery获取url域名及参数的方法
  2. [转]Unity3D新手教学,让你十二小时,从入门到掌握!(一)
  3. FHQ TREAP 学习总结
  4. 华为p10 android几,华为P10测评:市场上真心没有比华为更强劲的安卓机了
  5. QQ群头像 微信群头像 多图合并框架实现
  6. DirectShow 下载
  7. word中图片不显示怎么办
  8. OpenCV实战——拟合直线
  9. 靠部落格打响品牌 一个人赚全世界的钱
  10. reactjs 视频教程