Skip to content

Instantly share code, notes, and snippets.

@Jack-Saleem
Created January 15, 2016 13:21
Show Gist options
  • Save Jack-Saleem/5fdb313fb0ed88685d99 to your computer and use it in GitHub Desktop.
Save Jack-Saleem/5fdb313fb0ed88685d99 to your computer and use it in GitHub Desktop.
Codeforces 133A HQ9+ program in java
import java.util.Scanner;
public class HQ9
{
public static void main(String args[])
{
Scanner ip = new Scanner(System.in);
String s = ip.next();
if(s.contains("H")||s.contains("Q")||s.contains("9"))
System.out.println("YES");
else if(s.contains("+")||s.contains("="))
System.out.println("NO");
else
System.out.println("NO");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment