Tuesday, January 21, 2020

Codeforces 133A HQ9+ Solution in C

  1. #include<stdio.h>
  2. #include<string.h>
  3. int main()
  4. {
  5. int i,n,p=0;
  6. char s[120];
  7. scanf("%s",s);
  8. n=strlen(s);
  9. for (i=0;i<n;i++)
  10. {
  11. if (s[i]=='H' || s[i]=='Q' || s[i]=='9')
  12. {
  13. p++;break;
  14. }
  15. }
  16. if (p>0) printf("YES\n");
  17. else printf("NO\n");
  18. return 0;
  19. }

No comments:

Post a Comment

Codeforces 131A cAPS lOCK Solution in C

#include <stdio.h> int main () { char ch [ 106 ]; int i , j , ck = 1 ; scanf ( "%s" , ch ); ...