Vowel Counting
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 1323 Accepted Submission(s): 979
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.
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.
#include<stdio.h>
#include<string.h>
int main()
{
int t,i;
char s[60];
while(scanf("%d",&t)!=EOF)
{
getchar();
while(t--)
{
gets(s);
for(i=0;i<strlen(s);i++)
{
if(s[i]>='A'&&s[i]<='Z')
s[i]=s[i]+'a'-'A';
}
for(i=0;i<strlen(s);i++)
{
if(s[i]=='a'||s[i]=='e'||s[i]=='i'||s[i]=='o'||s[i]=='u')
s[i]=s[i]-'a'+'A';
}
puts(s);
}
}
return 0;
}