统计元音 2027
来源:互联网 发布:电脑打字赚钱软件 编辑:程序博客网 时间:2024/05/21 17:17
统计元音
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 28521 Accepted Submission(s): 11807
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
Author
lcy
Source
C语言程序设计练习(四)
Recommend
lcy
突然发现自己连scanf和gets都分不清。
#include<iostream>
#include<cstring>
using namespace std;
int main()
{
int n,a,b,c,d,e,f;
scanf("%d",&n);
getchar();
char s[101];
while(n--)
{
a=b=c=d=e=0;
gets(s);
for(int i=0;i<strlen(s);i++)
{
if(s[i]=='a')a++;
else if(s[i]=='e')b++;
else if(s[i]=='i')c++;
else if(s[i]=='o')d++;
else if(s[i]=='u')e++;
}
printf("a:%d\ne:%d\ni:%d\no:%d\nu:%d\n",a,b,c,d,e);
if(n)
printf("\n");
}
return 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 统计元音
- poj 3071 概率dp
- HDU--杭电--3415--Max Sum of Max-K-sub-sequence--队列--双向队列
- HDU_4239_Decoding EDSAC Data(模拟)
- Python 新手常犯错误
- mysqldump.exe 问题
- 统计元音 2027
- Cortex-A8上移植rt3070驱动出错
- Extjs主界面基础上继续生成导航(step 2)
- infopath 解析
- python set
- 标准C++ RTTI的仿MFC实现 - 只用2个宏来实现"根据对象名创建对象"
- 数据库之mysql存储过程 触发器
- 阿里集团IPO估值千亿
- poj 3114 Countries in War(Tarjan+floyd)