Question: HQ 9 + is a joke programming language which has only four one - character instructions: H prints Hello, World!, Q
HQ is a joke programming language which has only four onecharacter instructions:
H prints "Hello, World!",
Q prints the source code of the program itself,
prints the lyrics of Bottles of Beer" song,
increments the value stored in the internal accumulator.
Instructions H and Q are casesensitive and must be uppercase. The characters of the program which are not instructions are ignored.
You are given a program written in HQ 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 HQ String p will contain between and characters, inclusive. ASCIIcode of each character of p will be between exclamation mark and tilde inclusive.
Output
Output "YES", if executing the program will produce any output, and NO otherwise
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
