HDU 2027 统计元音
来源:互联网 发布:大数据安全需求分析 编辑:程序博客网 时间:2024/05/24 06:01
统计元音
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 71456 Accepted Submission(s): 28312
Problem Description
统计每个元音字母在字符串中出现的次数。
Input
输入数据首先包括一个整数n,表示测试实例的个数,然后是n行长度不超过100的字符串。
Output
对于每个测试实例输出5行,格式如下:
a:num1
e:num2
i:num3
o:num4
u:num5
多个测试实例之间由一个空行隔开。
请特别注意:最后一块输出后面没有空行:)
Sample Input
2
aeiou
my name is ignatius
Sample Output
a:1
e:1
i:1
o:1
u:1
a:2
e:1
i:3
o:0
u:1
这个题是真简单,但是输出的格式和平常一样的恶心。唉。
#include "cstdio"#include "algorithm"#include "cmath"#include "cstring"using namespace std;int main(){ int i, j, k, l, m, n, t, i1; char b[105]; scanf("%d",&n); getchar(); int flag=0; while(n--) { fgets(b,sizeof(b),stdin); int a=0,e=0,i1=0,o=0,u=0; int len=strlen(b); for(i=0;i<len;i++) { if(b[i]=='a') a++; if(b[i]=='e') e++; if(b[i]=='i') i1++; if(b[i]=='o') o++; if(b[i]=='u') u++; } if(flag==1) printf("\n"); printf("a:%d\ne:%d\ni:%d\no:%d\nu:%d\n",a,e,i1,o,u); flag=1; } return 0; }
阅读全文
0 0
- hdu 2027 统计元音
- HDU 2027 统计元音
- HDU 2027 统计元音
- Hdu 2027 - 统计元音
- HDU 2027 统计元音
- HDU 2027 统计元音
- HDU 2027 统计元音
- HDU 2027 统计元音
- HDU 2027 - 统计元音
- hdu-2027-统计元音
- [hdu 2027] 统计元音
- HDU 2027 统计元音
- HDU 2027 统计元音
- HDU 2027 统计元音
- hdu 2027 统计元音
- HDU 2027 -- 统计元音
- HDU 2027 统计元音
- HDU 2027 统计元音
- mysql_触发器
- 『ORACLE』 PLSQL—基本循环(11g)
- Linux c 网络编程
- 狼和羊的故事
- hihoCoder 1043 : 完全背包
- HDU 2027 统计元音
- mysql基础
- Intellij IDEA显示边侧栏maven等
- 『ORACLE』 PLSQL—case语句(11g)
- Qt5.7.0 mingw+qwtplot3D 编译
- Hibernate 缓存机制
- Intent(1)
- segment tree cf197D Xenia and Bit Operations
- 树莓派的购买