vendredi 15 mai 2015

if statement and puts()

Recently I have some across this solution on codeforces site. I couldn't understand the condition in the if statement and also the condition of the ternary operator in this question can someone please help me with this ?

include

int main(void)
{
int a[1000]={0},ans,k;
while((k=getchar())!='\n'){
if(!a[k]){
ans++;
a[k]=1;
}}
puts(ans&1 ? "IGNORE HIM!":"CHAT WITH HER!");
return 0;
}

Aucun commentaire:

Enregistrer un commentaire