HDU 3079 Vowel Counting (水题。。。判断元音)
题意:n个字符串,如果元音就是输出大写,否则输出小写。
析:没啥可说的,只要判断AEIOU就OK了。
代码如下:
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <queue>
#include <vector>
#include <cstring>
#include <map>
#include <cctype> using namespace std;
const int maxn = 70;
char s[maxn]; bool judge(char ch){
if('A' == towupper(ch) || 'E' == towupper(ch) || 'I' == towupper(ch) || 'O' == towupper(ch) || 'U' == towupper(ch))
return true;
return false;
} int main(){
int T;
scanf("%d", &T);
while(T--){
scanf("%s", s);
int n = strlen(s);
for(int i = 0; i < n; ++i)
if(judge(s[i])) printf("%c", towupper(s[i]));
else printf("%c", towlower(s[i]));
printf("\n");
}
return 0;
}
HDU 3079 Vowel Counting (水题。。。判断元音)的更多相关文章
- UVa 1225 Digit Counting --- 水题
UVa 1225 题目大意:把前n(n<=10000)个整数顺次写在一起,12345678910111213...,数一数0-9各出现多少字 解题思路:用一个cnt数组记录0-9这10个数字出现 ...
- HDU 4950 Monster (水题)
Monster 题目链接: http://acm.hust.edu.cn/vjudge/contest/123554#problem/I Description Teacher Mai has a k ...
- HDU—2021-发工资咯(水题,有点贪心的思想)
作为杭电的老师,最盼望的日子就是每月的8号了,因为这一天是发工资的日子,养家糊口就靠它了,呵呵 但是对于学校财务处的工作人员来说,这一天则是很忙碌的一天,财务处的小胡老师最近就在考虑一个问题:如果每 ...
- hdu 1106:排序(水题,字符串处理 + 排序)
排序 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submissi ...
- HDU 4813 Hard Code 水题
Hard Code Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://acm.hust.edu.cn/vjudge/contest/view.act ...
- HDU 4593 H - Robot 水题
H - RobotTime Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hust.edu.cn/vjudge/contest/view.act ...
- HDOJ/HDU 2560 Buildings(嗯~水题)
Problem Description We divide the HZNU Campus into N*M grids. As you can see from the picture below, ...
- HDOJ(HDU) 1859 最小长方形(水题、、)
Problem Description 给定一系列2维平面点的坐标(x, y),其中x和y均为整数,要求用一个最小的长方形框将所有点框在内.长方形框的边分别平行于x和y坐标轴,点落在边上也算是被框在内 ...
- HDU - 1716 排列2 水题
排列2 Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submis ...
随机推荐
- position_css
position: 定位,元素的定位与这五个属性相关.left,top,bottom,right,z-index 1. static (默认值).没有定位,五个属性都不起作用. 2. inherit ...
- WP runtime local setting
https://msdn.microsoft.com/en-us/library/windows/apps/windows.storage.applicationdata.localsettings. ...
- C# 事件 event 【转】
C#事件(event)解析 事件(event),这个词儿对于初学者来说,往往总是显得有些神秘,不易弄懂.而这些东西却往往又是编程中常用且非常重要的东西.大家都知道windows消息处理机制的重要, ...
- vue 解决报错1
[Vue warn]: You are using the runtime-only build of Vue where the template compiler is not available ...
- sqlserver列重命名
EXEC sp_rename 'tablename.[OldFieldName ]', 'NewFieldName', 'COLUMN'
- 分页导航jsp
<c:choose>标签与Java switch语句的功能一样,用于在众多选项中做出选择. switch语句中有case,而<c:choose>标签中对应有<c:when ...
- ssh 设置反向代理
远程主机上/etc/ssh/sshd_config中,开启 GatewayPorts yes systemctl reload sshd 本地: ssh -CqTnN -R 0.0.0.0:9000: ...
- Xpath同时选取不同属性的元素
如:一个论坛中,有置顶贴和普通贴,它们使用了不同的class,但这两类帖子都是需要的内容,需要同时爬下来 假设置顶贴class="top",普通贴class="commo ...
- javascript 中 if (window != top) top.location.href = location.href;的意思
如果当前窗口不是顶级窗口,就强制修改为顶级窗口: 目的是为了不让别人用iframe嵌入你的页面
- 139. Word Break (String; DP)
Given a string s and a dictionary of words dict, determine if s can be segmented into a space-separa ...