A. Boy or Girl

点击打开题目
time limit per test

1 second

memory limit per test

256 megabytes

input

standard input

output

standard 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).

Sample test(s)
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!".

#include <iostream>
#include<memory.h>
#include<stdlib.h>
using namespace std;
int cmp(const void *a,const void *b)
{
return *(char *)a-*(char *)b;
}
int main()
{
char c[101];
int k,s,i,j;
while(cin>>c)
{
s=0;
k=strlen(c);
qsort(c,k,sizeof(c[0]),cmp);
for(i=0,j=1; i<k; i++)
{
if(c[i]!=c[j])
{
j++;
s++;
}
else
{
j++;
}
}
if(s%2==0)
{
cout<<"CHAT WITH HER!"<<endl;
}
else
cout<<"IGNORE HIM!"<<endl;
memset(c,'\0',sizeof(c));
}
return 0;
}

版权声明:本文博客原创文章,博客,未经同意,不得转载。

codeforces 236A . Boy or Girl(串水问题)的更多相关文章

  1. 『NYIST』第八届河南省ACM竞赛训练赛[正式赛一]-CodeForces 236A,虽然很水,但有一个很简单的函数用起来方便

    A. Boy or Girl time limit per test 1 second memory limit per test 256 megabytes input standard input ...

  2. Educational Codeforces Round 7 B. The Time 水题

    B. The Time 题目连接: http://www.codeforces.com/contest/622/problem/B Description You are given the curr ...

  3. Educational Codeforces Round 7 A. Infinite Sequence 水题

    A. Infinite Sequence 题目连接: http://www.codeforces.com/contest/622/problem/A Description Consider the ...

  4. Codeforces Testing Round #12 A. Divisibility 水题

    A. Divisibility Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/597/probl ...

  5. Codeforces Beta Round #37 A. Towers 水题

    A. Towers 题目连接: http://www.codeforces.com/contest/37/problem/A Description Little Vasya has received ...

  6. Codeforces Round #394 (Div. 2)A水 B暴力 C暴力 D二分 E dfs

    A. Dasha and Stairs time limit per test 2 seconds memory limit per test 256 megabytes input standard ...

  7. Codeforces Round #169 (Div. 2) A水 B C区间更新 D 思路

    A. Lunch Rush time limit per test 2 seconds memory limit per test 256 megabytes input standard input ...

  8. codeforces 712B B. Memory and Trident(水题)

    题目链接: B. Memory and Trident time limit per test 2 seconds memory limit per test 256 megabytes input ...

  9. codeforces 712A A. Memory and Crow(水题)

    题目链接: A. Memory and Crow time limit per test 2 seconds memory limit per test 256 megabytes input sta ...

随机推荐

  1. 【教你zencart仿站 文章1至6教训 高清1280x900视频下载】[支持手机端]

    [教你zencart仿站 第1至6课 高清晰1280x900视频下载][支持移动端] 经过筹备, 我们的课件最终出来了- 我们 zencart联盟合伙人 项目推出的 在线yy同步演示zencart仿站 ...

  2. JSTL 中<c:forEach>使用

    <c:forEach 详解 博客分类: JSTL   <c:forEach>标签用于通用数据循环,它有以下属性 属 性 描 述 是否必须 缺省值 items 进行循环的项目 否 无 ...

  3. python学习笔记之七:魔法方法,属性

    在python中,有的名称会在前面和后面加上两个下划线,由这些名字组成的集合所包含的方法称为魔法方法(或者是特殊方法).如果对象实现了这些方法中的某一个,那么这个方法会在特殊的情况下(确切地说是根据名 ...

  4. MySQL和Oracle开发差异

    1)  数据类型差异 Oracle MySQL 注释 单独创建序列来实现 自动增长的数据类型 varchar2 varchar number tinyint,smallint,mediumint,in ...

  5. MVC EF 增 删 改 查

    using System;using System.Collections.Generic;using System.Linq;using System.Web;//using System.Data ...

  6. 在JBuilder8中使用ANT

    在JBuilder8中使用ANT                                                            作者:翁驰原    在JBuilder8中,Ap ...

  7. 如何插上U盘 自动复制内容

    U盘插入自动复制,有效对付那些不肯给PPT的老师,还有一定几率拿到期末考试卷子···有图有真相!业界良心的好东西!!现在看还来得及!!! 代码优化了一下,把不是很重要的都删掉了,这次使用时看不出任何现 ...

  8. Convert View To Bitmap

    public static Bitmap convertViewToBitmap(View view) { view.destroyDrawingCache(); view.measure(View. ...

  9. 在 VS 类库项目中 Add Service References 和 Add Web References 的区别

    原文:在 VS 类库项目中 Add Service References 和 Add Web References 的区别 出身问题: 1.在vs2005时代,Add Web Reference(添加 ...

  10. JSON小结

    在 JSON 中,“Object” 是什么呢? json.org 有很好的解释: 1 .An object is an unordered set of name/value pairs. 2.An ...