`
bcyy
  • 浏览: 1827130 次
文章分类
社区版块
存档分类
最新评论

杭电1219

 
阅读更多

题目地址:http://acm.hdu.edu.cn/showproblem.php?pid=1219

C语言源码:

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


分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics