2027 统计元音
来源:互联网 发布:nginx与lvs 编辑:程序博客网 时间:2024/06/05 02:35
统计元音
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 37413 Accepted Submission(s): 15426
Problem Description
统计每个元音字母在字符串中出现的次数。
Input
输入数据首先包括一个整数n,表示测试实例的个数,然后是n行长度不超过100的字符串。
Output
对于每个测试实例输出5行,格式如下:
a:num1
e:num2
i:num3
o:num4
u:num5
多个测试实例之间由一个空行隔开。
请特别注意:最后一块输出后面没有空行:)
a:num1
e:num2
i:num3
o:num4
u:num5
多个测试实例之间由一个空行隔开。
请特别注意:最后一块输出后面没有空行:)
Sample Input
2aeioumy name is ignatius
Sample Output
a:1e:1i:1o:1u:1a:2e:1i:3o:0u:1
#include<cstdio>#include<string>int main(){ int n; while(scanf("%d",&n)==1) { getchar(); for(int x=0;x<n;x++) { char s[101]; gets(s); int a=0,e=0,i=0,o=0,u=0; for(int m=0;s[m];m++) { switch(s[m]) { case 'a':a++;break; case 'e':e++;break; case 'i':i++;break; case 'o':o++;break; case 'u':u++;break; default :; } } printf("a:%d\ne:%d\ni:%d\no:%d\nu:%d\n",a,e,i,o,u); if(x==n-1);//处理一下最后一个空行 else printf("\n"); } } return 0;}
0 0
- hdu 2027 统计元音
- 2027 统计元音
- HDU 2027 统计元音
- HDU 2027 统计元音
- Hdu 2027 - 统计元音
- HDU 2027 统计元音
- HDU 2027 统计元音
- 统计元音 2027
- HDU 2027 统计元音
- HDU 2027 统计元音
- HDU 2027 - 统计元音
- hdu-2027-统计元音
- [hdu 2027] 统计元音
- 2027 统计元音
- HUDJ 2027 统计元音
- HDU 2027 统计元音
- HDU 2027 统计元音
- hdoj 2027 统计元音
- java利用反射访问类的私有(private)属性及方法
- 【黑马程序员】线程基本概念(六)
- linux下安装geant4
- 让Xcode Lua 语法高亮
- Linux中的无线架构
- 2027 统计元音
- [思路题] spoj 11354 Amusing numbers
- 把抱怨的时间都用来思考(呼唤你的思想)
- 打造通用的Android下拉刷新组件(适用于ListView、GridView等各类View)
- ACM 350. 小吃店(背包变形)
- aiff 文件格式简述
- struts开发
- HDU-#4788 Hard Disk Drive
- 最短路和次短路的条数(dijstra算法或spfa算法)POJ3463