【hdu2027】统计元音
来源:互联网 发布:淘宝网红直播推广费用 编辑:程序博客网 时间:2024/06/04 18:29
E - 统计元音
Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u
Submit Status Practice HDU 2027
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<stdio.h>#include<string.h>#include<string.h>int main(){ int m,n,t,r,k,i,j,d,e,f,g,h; char a[110]; scanf("%d",&n); getchar(); while(n--) { d=0;e=0;f=0;g=0;h=0; gets(a); k=strlen(a); for(i=0;i<k;i++) { if(a[i]=='a') d++; if(a[i]=='e') e++; if(a[i]=='i') f++; if(a[i]=='o') g++; if(a[i]=='u') h++; if(a[i]==' ') continue; } printf("a:%d\ne:%d\ni:%d\no:%d\nu:%d\n",d,e,f,g,h); if(n!=0) printf("\n"); }return 0;}
阅读全文
0 0
- hdu2027 统计元音
- hdu2027 统计元音
- hdu2027 统计元音
- HDU2027 统计元音
- HDU2027 统计元音
- HDU2027统计元音
- HDU2027---统计元音
- HDU2027统计元音
- 【hdu2027】统计元音
- HDU2027 统计元音【入门】
- HDU2027:统计元音
- hdu2027 统计元音(C语言)
- 统计元音
- 统计元音
- 统计元音
- 统计元音
- 统计元音
- 统计元音
- 342. Power of Four
- HTML学习2---body常用属性以及文本修饰标记
- react redux 学习2
- 线性方程组
- PHP常用函数
- 【hdu2027】统计元音
- Storm与Spark:谁才是我们的实时处理利器
- fbcunn在Ubuntu 14.04下安装可能出现的问题以及解决方法
- Java学习第十四天
- git 创建/删除本地/远程分支
- Springboot-系统异常统一处理(接口编程异常处理)
- 常用类的对比
- 【项目搭建】使用spring-boot进行REST风格的微服务开发入门
- nltk 中的 sents 和 words