Девушка и Юноша с count

mail@pastecode.io avatar
unknown
plain_text
2 years ago
401 B
0
Indexable
Never
#include <iostream>
#include <string>
using namespace std;
int main()
{
    int n = 0;
    bool yes;
    string s;
    cin >> s;
    for (int i = 0; i < s.size(); i++) {
        if (count(s.begin(), s.begin() + i + 1, s[i]) == 1) { 
            n += 1; 
        }
    }
    if (n % 2 == 1) {
        cout << "IGNORE HIM!";
    }
    else {
        cout << "CHAT WITH HER!";
    }
}