Boy or Girl

简介: Boy or Girl

文章目录

一、Boy or Girl

总结


一、Boy or Girl

本题链接:Boy or Girl


题目:


A. Boy or Girl

time limit per test1 second

memory limit per test256 megabytes

inputstandard input

outputstandard output

Those days, many boys use beautiful girls’ photos as avatars in forums. So it is pretty hard to tell the gender of a user at the first glance. Last year, our hero went to a forum and had a nice chat with a beauty (he thought so). After that they talked very often and eventually they became a couple in the network.


But yesterday, he came to see “her” in the real world and found out “she” is actually a very strong man! Our hero is very sad and he is too tired to love again now. So he came up with a way to recognize users’ genders by their user names.


This is his method: if the number of distinct characters in one’s user name is odd, then he is a male, otherwise she is a female. You are given the string that denotes the user name, please help our hero to determine the gender of this user by his method.


Input

The first line contains a non-empty string, that contains only lowercase English letters — the user name. This string contains at most 100 letters.


Output

If it is a female by our hero’s method, print “CHAT WITH HER!” (without the quotes), otherwise, print “IGNORE HIM!” (without the quotes).


Examples


input

wjmzbmr


output

CHAT WITH HER!


input

xiaodao


output

IGNORE HIM!


input

sevenkplus


output

CHAT WITH HER!


Note

For the first example. There are 6 distinct characters in “wjmzbmr”. These characters are: “w”, “j”, “m”, “z”, “b”, “r”. So wjmzbmr is a female and you should print “CHAT WITH HER!”.


本博客给出本题截图:

image.png

题意:如果输入的字符串中字符相同的个数是奇数的话就是男生,反之是女生

AC代码

#include <iostream>
using namespace std;
const int N = 110;
char s[N];
int res; 
int main()
{
  cin >> s;
  for (int i = 0; s[i]; i ++ )
  {
    bool flag = true;
    for (int j = 0; j < i; j ++ )
      if (s[i] == s[j])
        flag = false;
    if (flag) res ++;
  }
  if (res % 2) puts("IGNORE HIM!");
  else puts("CHAT WITH HER!");
  return 0;
}

总结

quote 引号

forum 论坛

avatar 化身

determine 造成

水题,不解释


目录
相关文章
|
7月前
|
定位技术
牛和 John
牛和 John
45 0
Andy’s First Dictionary( stringstream )
Andy’s First Dictionary( stringstream )
92 0
Student s =new Student();完成了那些事情?
Student s =new Student();完成了那些事情?
102 0
I_love_%username%
I_love_%username%
119 0
I_love_%username%
|
程序员 Windows
Fiven 李亚男
这是一次专业课课堂考核作业
|
弹性计算 前端开发 小程序
Student:T9M1 sean
在第一次使用时,平台还提供了教程,只需要用心花点时间完成其中的场景实践和技能自测就可以啦。并且每一步都有很详细的教程,包括如何体验ECS云服务器的新手场景以及了解其中的概念和基础操作。对于我这种之前没使用过云服务器的人来说真的非常友好。
|
SQL Java 中间件
SELECT * FROM GIRLS WHERE AGE BETWEEN 20 AND 24 ...
阿粉最近看到一张图,如上所示,原本只是一个搞笑的图,但是在阿粉看来这分明是个渣男啊!一句普通的 SQL 语句SELECT * FROM GIRLS WHERE AGE BETWEEN 20 AND 24 AND BOYFRIEND IS NULL,也有很多内涵! 什么?没看出来?来,阿粉带你品品。
SELECT * FROM GIRLS WHERE AGE BETWEEN 20 AND 24 ...
|
弹性计算 Java 关系型数据库
New Boy
New boy是我最喜欢的朴树的歌,我是一个在天坑专业挣扎的学生,自己怀揣着从小对计算机的热爱走上转行之路,从前的我做错了很多的事,现在也深深知道社会的残酷和“选择大于努力”的真理。在之前暗无天日的迷茫和徘徊中,我坚持了下来,在计算机这条路上我终于看到了未来的曙光,也深深理解了乔帮主说的,“要找到自己喜欢并擅长的事情,并为之奋斗终身,如果还没有找到,那就继续找”。我现在可以肯定的说,我找到了,并同时作为向过去的告别,我给这篇文章起名New boy,希望自己能重新开始,未来路还很长,请多多指教!
436 0
New Boy