[Codeforces Round #146 (Div. 2)]A. Boy or Girl

地址:http://codeforces.com/contest/236/problem/A

要求统计一串字符中出现了多少个字母

 1 #include<stdio.h>
 2 
 3 int a[26];
 4 
 5 int main()
 6 {
 7     int count=0;
 8     char in;
 9     in=getchar();
10     while(in-'a'>=0 && in-'a'<26)
11     {
12         if(0==a[in-'a'])
13         {
14             count++;
15             a[in-'a']=1;
16         }
17         in=getchar();
18     }
19     if(count%2==0) printf("CHAT WITH HER!\n");
20     else printf("IGNORE HIM!\n");
21     return 0;
22 }

 

posted @ 2013-01-21 01:20  tjsuhst  阅读(132)  评论(0)    收藏  举报