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 造成

水题,不解释


目录
相关文章
|
1月前
|
SQL 前端开发 BI
情侣小窝 Like_Girl源码V5.1.1
前后端都是使用了 grid 栅格 flex 弹性布局 高斯模糊效果 前端简约配色没有过多的复杂效果 前端首页分四个子页面 点点滴滴 留言板 关于我们 恋爱列表
14 0
情侣小窝 Like_Girl源码V5.1.1
CF236A Boy or Girl(找字符数,可以考虑去重)
CF236A Boy or Girl(找字符数,可以考虑去重)
43 0
|
程序员 Windows
I_love_%username%
I_love_%username%
100 0
I_love_%username%
Fiven 李亚男
这是一次专业课课堂考核作业
|
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,希望自己能重新开始,未来路还很长,请多多指教!
405 0
New Boy
|
程序员
如何俘获一个IT男的心?
不知道从什么时候开始, “IT男”成了大家重点研究对象。 问题:“如何俘获一个IT男的心” 引来各路英雄豪杰纷纷出谋献计。 正所谓对症下药,方见奇效。 对于处于不同阶段的“IT男”, 如:“程序猿”和“IT管理者”, 都有哪些奇思妙计,才能俘获他们呢? 程序猿篇 《如何俘获一个IT男,让他成为男友然后变成老公》 1.在很久很久以前,我有一个哥们, 2.哥们某天喝酒吃肉打游戏的时候,赞我和我老婆很腻, 3.我建议哥们也找一个女友, 4.哥们吃了一口牛肉说,事业第一,先立业,后成家。
1727 0