杭电3079 Vowel Counting
2015-11-10 20:06
381 查看
Vowel Counting
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1986 Accepted Submission(s): 1460
Problem Description
The "Vowel-Counting-Word"(VCW), complies with the following conditions.
Each vowel in the word must be uppercase.
Each consonant (the letters except the vowels) must be lowercase.
For example, "ApplE" is the VCW of "aPPle", "jUhUA" is the VCW of "Juhua".
Give you some words; your task is to get the "Vowel-Counting-Word" of each word.
Input
The first line of the input contains an integer T (T<=20) which means the number of test cases.
For each case, there is a line contains the word (only contains uppercase and lowercase). The length of the word is not greater than 50.
Output
For each case, output its Vowel-Counting-Word.
Sample Input
4
XYz
application
qwcvb
aeioOa
Sample Output
xyz
ApplIcAtIOn
qwcvb
AEIOOA
Author
AppleMan
Source
HDU 2nd “Vegetable-Birds Cup” Programming
Open Contest
Recommend
lcy | We have carefully selected several similar problems for you: 3082 3081 3080 3086 3087
好水:
#include<stdio.h>
#include<string.h>
#include<algorithm>
using namespace std;
char s[55];
int i,k,l,m,n;
int main()
{
scanf("%d",&k);
while(k--)
{
scanf("%s",s);
l=strlen(s);
for(i=0;i<l;i++)
{
if(s[i]=='a'||s[i]=='e'||s[i]=='i'||s[i]=='o'||s[i]=='u')
s[i]=s[i]-32;
if('A'<=s[i]&&s[i]<='Z'&&s[i]!='A'&&s[i]!='E'&&s[i]!='I'&&s[i]!='U'&&s[i]!='O')
s[i]=s[i]+32;
}
for(i=0;i<l;i++)
printf("%c",s[i]);
printf("\n");
}
}
相关文章推荐
- 杭电1870 愚人节的礼物
- 关于杭电1405 The Last Practice 的问题
- hdu-1103 模拟题。
- hdu-1022 栈的应用。
- hdu-1247 简单map的应用。(字典树)
- hdu-1251 字典树公共前缀。
- hdu-1075 map映射表的应用。
- hdu 1005 -- Number Sequence
- hdu 1007 -- Quoit Design
- 杭电1004
- 杭电1005
- 杭电1008
- c++编写藏手帕问题
- 杭电oj-1003
- 杭电oj-1004
- 杭电oj-1005
- 杭电ACM 1002
- 赛马网ACM试题(原杭电oj ACM)java版答案(1000,10001,1002)
- 杭电_人见人爱A^B
- 杭电1009题