Untitled
unknown
plain_text
2 years ago
825 B
15
Indexable
#include<bits/stdc++.h>
using namespace std;
int main(){
string str;
int count;
getline(cin,str);
int temp=0;
//Counts each character present in the string
int l=str.length();
for(int i = 0; i <l; i++) {
count = 1; //Updates the count again to 1 for every new character
for(int j = i+1; j < l; j++) {
if(str[i] == str[j] && str[i] != ' ') {
count++;
//Set string[j] to 0 to avoid printing the visited character
str[j] = '0';
}
}
//A character is considered as duplicate if count is greater than 1
if(count > 1 && str[i] != '0')
temp++;
}
//cout<< temp<<'\n';
int acstr= str.size()-temp;
if(acstr%2==0){
cout<< "CHAT WITH HER!"<< endl;
}
else{
cout<< "IGNORE HIM!"<< endl;
}
return 0;
}Editor is loading...