Tuesday, May 31, 2016

CODEFORCES problem 236A Boy or Girl

Problem link (Click here)

#include <iostream>
#include <cstdio>
#include<cstdlib>
#include <cstring>
#include<algorithm>

using namespace std;

int main()
{
    char word[100];
    cin>>word;
    int length=strlen(word);
    sort(word,word+length);
    int i, count = 0;
    for(i=0; i<length; i++){
        if(word[i]!=word[i+1]){
            count++;
        }
    }
    if(count%2==0)
        cout<<"CHAT WITH HER!"<<endl;

    else
        cout<<"IGNORE HIM!"<<endl;

    return 0;
}

No comments:

Post a Comment