A - Boy or Girl
Problem Link: [Codeforces 236A##link##]
- [tab]
- C++
#include<bits/stdc++.h> using namespace std; int main() { string s; cin>>s; sort(&s[0],&s[s.length()]); int count=0; for(int i=0;i<s.length();i++) { if(s[i]==s[i-1]) { continue; } count++; } if(count%2) cout<<"IGNORE HIM!\n"; else cout<<"CHAT WITH HER!\n"; }
- Python3
s = input() n = len(set(s)) if(n%2==0): print("CHAT WITH HER!") else: print("IGNORE HIM!")
- JAVA
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String s = sc.nextLine(); System.out.println(s.chars().distinct().count()%2==0? "CHAT WITH HER!":"IGNORE HIM!"); } }