Codeforces Round #146 (Div. 2), problem: (A) Boy or Girl editorial: http://codeforces.com/blog/entry/5592
Codeforces Round #146 (Div. 2), problem: (A) Boy or Girl solution: http://ideone.com/SdHXlb
#include <iostream> #include <cstdio> #include <cstring> using namespace std; int main() { int a[30]={0}, cnt=0; char s[105]; scanf("%s", s); for(int i=0; i<strlen(s); i++) { if(a[s[i]-97]==0) cnt++; a[s[i]-97]++; } if(cnt%2==0) printf("CHAT WITH HER!"); else printf("IGNORE HIM!"); return 0; }
No comments:
Post a Comment