您的位置:首页 > 其它

杭电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");
}
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  杭电