HDU 3079 Vowel Counting
来源:互联网 发布:单片机 精确测量电阻 编辑:程序博客网 时间:2024/06/04 20:09
Vowel Counting
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 824 Accepted Submission(s): 645
Total Submission(s): 824 Accepted Submission(s): 645
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.
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.
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
4XYzapplicationqwcvbaeioOa
Sample Output
xyzApplIcAtIOnqwcvbAEIOOA
这题就是将元音字母变成大写,辅音字母变成小写。
AC代码:
#include<iostream>#include<string.h>#include<ctype.h>using namespace std;int main(){ int n,l,i; char s[55]; while(scanf("%d",&n)!=EOF) { while(n--) { getchar(); scanf("%s",s); l=strlen(s); for(i=0;i<l;i++) { if(s[i]>='A'&&s[i]<='Z') { if(s[i]=='A'||s[i]=='I'||s[i]=='E'||s[i]=='O'||s[i]=='U')printf("%c",s[i]); else printf("%c",tolower(s[i])); } else { if(s[i]=='a'||s[i]=='i'||s[i]=='o'||s[i]=='u'||s[i]=='e')printf("%c",toupper(s[i])); else printf("%c",s[i]); } } printf("\n"); } } return 0;}
- HDU 3079 Vowel Counting
- HDU 3079 Vowel Counting
- hdu-3079-Vowel Counting
- hdu 3079 Vowel Counting
- hdu 3079 Vowel Counting(模拟)
- hdu 3079(Vowel Counting)
- HDU 3079 Vowel Counting 元音字母大写
- HDU 3079 Vowel Counting (水)
- 3079:Vowel Counting
- hd 3079 Vowel Counting
- HDU ACMstep1.2.8 Vowel counting
- HDU 1.2.8 Vowel Counting
- HDU 1.2.8 Vowel Counting
- 杭电3079 Vowel Counting
- Vowel Counting
- Vowel Counting
- Vowel Counting
- Vowel Counting
- 选择排序学习
- java.lang.IllegalArgumentException: already added: Lorg/apache/poi/EncryptedDocumentException;
- 平台+插件软件设计思想基于COM原型实现的代码剖析
- 漾七夕
- C# NPOI 操作excel
- HDU 3079 Vowel Counting
- 布局中@null的代码实现方式
- 知道国外投行为什么要中国开放证券融资不?
- Microsoft Enterprise Library 5.0 系列(一) Caching Application Block (高级)
- HibernateDaoSupport的使用
- 理解 Ruby Symbol (Ruby中的冒号)
- ECSHOP批量上传加入自定义商品属性
- 为什么我们程序员难晋升
- archlinux下opera不能使用ibus的解决办法