博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
codeforces 236A . Boy or Girl(串水问题)
阅读量:6818 次
发布时间:2019-06-26

本文共 1939 字,大约阅读时间需要 6 分钟。

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 
#include
#include
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

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

你可能感兴趣的文章
构建VIM下的C++编程环境
查看>>
browserSync 工具
查看>>
一个随机排序集合的思考
查看>>
字符数组中查找字符串或字符数组
查看>>
JAVA自己理解的几种设计模式
查看>>
FFmpeg 常用命令收集
查看>>
安装 Scala
查看>>
蒙特卡罗(Monte Carlo)方法简介
查看>>
PIE SDK符号选择器
查看>>
python 爬虫
查看>>
【Mysql】使用子查询提高MySQL分页效率 limit(摘自网络)
查看>>
IDEA的Maven配置
查看>>
购物车
查看>>
读《大道至简》有感
查看>>
别人总结的一些drupal模块(1)
查看>>
第一篇博客 iframe自适应高度
查看>>
android异步加载图片并缓存到本地实现方法
查看>>
成长杂记
查看>>
黑马程序员---SQL进阶之事务、视图和存储过程
查看>>
xcode Simulated Metrics xib设置小问题
查看>>