HDU-2027 统计元音
来源:互联网 发布:wifi自动切换软件 编辑:程序博客网 时间:2024/05/24 07:39
HDU-2027 统计元音
题目大意:统计一句英语语句中的元音字母 a,e,i,o,u 的个数(特别注意:最后一块输出后面没有空行)
Sample Input
2
aeiou
my name is ignatius
i want to get an accepted
Sample Output
a:1
e:1
i:1
o:1
u:1
a:2
e:1
i:3
o:0
u:1
解题思路:对每个字符进行判断。
#include <iostream>using namespace std;int main() { char s[500]; while (gets_s(s) != NULL) { int len = strlen(s); if (s[0] >= 97 && s[0] <= 122) s[0] -= 32; for (int i = 0; i < len; i++) { if (s[i] == 32 && (s[i + 1] >= 97 && s[i + 1] <= 122)) s[i + 1] -= 32; } cout << s << endl; } 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 统计元音
- [python]urllib3中的连接池--Poolmanager
- maven
- tinyhttpd源码详解 转载自 技术菌的blog
- Android之SurfaceView学习(一)
- 离职信之鸿宇篇
- HDU-2027 统计元音
- 【爬虫-反爬虫】系列一:-尾篇(7)
- 数据结构学习笔记4——单链表的实现
- 从零开始-uboot的移植-前期准备:uboot是如何启动倒数,启动内核的
- c++11 --- override and final 的阅读笔记摘要
- SimpleAdapter学习
- 关于Alamofire缓存机制的分享
- 2016夏季练习——dp
- [CityHunter]游戏设计需求及进度总控