I just start out on CodeForces. And I just encounter a problem, the code run on CodeForces compiler but not on my Codeblock (20.03 GCC version 8.1.0). I use windows 10. This problem on CodeForces: The problem.
- this is the solution:
#include<bits/stdc++.h>
using namespace std;
int main()
{
set<char> c;
char s;
while(cin>>s)c.insert(s);
cout<<(c.size()%2?"IGNORE HIM!":"CHAT WITH HER!");
}
When executing the provided code, I encountered an issue where it does not display the expected output as mentioned in the test case. Instead, when I copy the input from the test case and paste it into the console, the program keeps prompting for additional input without producing the desired output. It seems to be stuck in an infinite input loop.
I suspect that there might be an underlying problem with either the CodeBlocks program or the input provided by Codeforces when submitting the code.
So what is the problem? Thanks