Codeforces Beta Round #96 (Div. 2), problem: (A) HQ9+ solution: http://ideone.com/jm2lt4
#include <iostream> #include <stdio.h> #include <cstring> using namespace std; int main() { int flag; char s[105]; gets(s); flag=0; for(int i=0; i<strlen(s); i++) { if(s[i]=='H' || s[i]=='Q' || s[i]=='9') { printf("YES"); flag=1; break; } } if(flag==0) printf("NO"); return 0; }
No comments:
Post a Comment