300701: CF133A. HQ9+

Memory Limit:256 MB Time Limit:2 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

HQ9+

题意翻译

题目描述 HQ9+是一种搞笑的编程语言,只有4种指令,都是单个字符的: "H"输出"Hello, World!"; "Q"输出这个程序本身的源代码; "9"输出歌曲"99 Bottles of Beer"的歌词(你可以自己上网搜这首歌); "+"增加内部储存中的数值 注意"H"和"Q"指令是区分大小写的,必须使用大写。程序中不属于这些指令的字符请忽略。 给你一个用HQ9+写的程序,问这个程序是否会有任何输出。 输入输出格式 输入格式: 输入有一行,p是这个HQ9+的程序。字符串p的长度在1和100之间,包括1和100。字符串p中每一个字符的ASCII码在33('!'感叹号)和126('~'波浪)之间,包括33和126。 输出格式: 如果这个程序有输出,输出"YES",否则输出"NO"。 样例说明 第一个样例中只有一个指令"H",输出了"Hello, World!"。 第二个样例中没有任何一个字符是这个程序的指令。 翻译贡献者UID:68708

题目描述

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.

输入输出格式

输入格式


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 "YES", if executing the program will produce any output, and "NO" otherwise.

输入输出样例

输入样例 #1

Hi!

输出样例 #1

YES

输入样例 #2

Codeforces

输出样例 #2

NO

说明

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.

Input

题意翻译

题目描述 HQ9+是一种搞笑的编程语言,只有4种指令,都是单个字符的: "H"输出"Hello, World!"; "Q"输出这个程序本身的源代码; "9"输出歌曲"99 Bottles of Beer"的歌词(你可以自己上网搜这首歌); "+"增加内部储存中的数值 注意"H"和"Q"指令是区分大小写的,必须使用大写。程序中不属于这些指令的字符请忽略。 给你一个用HQ9+写的程序,问这个程序是否会有任何输出。 输入输出格式 输入格式: 输入有一行,p是这个HQ9+的程序。字符串p的长度在1和100之间,包括1和100。字符串p中每一个字符的ASCII码在33('!'感叹号)和126('~'波浪)之间,包括33和126。 输出格式: 如果这个程序有输出,输出"YES",否则输出"NO"。 样例说明 第一个样例中只有一个指令"H",输出了"Hello, World!"。 第二个样例中没有任何一个字符是这个程序的指令。 翻译贡献者UID:68708

加入题单

算法标签: