hdu 1219 AC Me

来源:互联网 发布:使用weka进行数据挖掘 编辑:程序博客网 时间:2024/05/21 17:43

http://acm.hdu.edu.cn/showproblem.php?pid=1219

#include<stdio.h>
#include<string.h>
char s[100001];
int a[26];
int main()
{
 int i;
while(gets(s))
{
 memset(a,0,sizeof(a));
for(i=0;i<strlen(s);i++)
{
if(s[i]>='a'&&s[i]<='z')
a[s[i]-'a']++;
}
for(i=0;i<26;i++)
printf("%c:%d\n",i+'a',a[i]);
printf("\n");
}
return 0;
}