就是查有几种不同的字母。。。
如果有偶数个 就输出
CHAT WITH HER!
如果是奇数个 就输出
IGNORE HIM!
#include <iostream>
#include <algorithm>
#include <string>
#include <cstring>
using namespace std;
string str;
int a[105];
int main ( ) {
cin >> str;
memset ( a, 0, sizeof ( a ) );
int len = str.length ( );
for ( int i = 0; i < len; ++i ) {
int t = str[i] - 'a' + 1;
a[t]++;
}
int tmp = 0;
for ( int i = 1; i <= 26; ++i )
if ( a[i] != 0 ) tmp++;
if ( tmp % 2 == 0 ) cout << "CHAT WITH HER!" << endl;
else cout << "IGNORE HIM!" << endl;
}
~
~