Vowel Counting

Time Limit : 2000/1000ms (Java/Other)   Memory Limit : 32768/32768K (Java/Other)
Total Submission(s) : 58   Accepted Submission(s) : 18
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

 #include <stdio.h>
#include <stdlib.h>
#include <string.h> int main()
{
int T,L,i;
char a[];
scanf("%d",&T);
while(T--)
{
scanf("%s",a);
L=strlen(a);
for(i=;i<L;i++)
{
if(a[i]=='a'||a[i]=='e'||a[i]=='i'||a[i]=='o'||a[i]=='u')
{
a[i]-=;
continue;
}
else if(a[i]=='A'||a[i]=='E'||a[i]=='I'||a[i]=='O'||a[i]=='U')
{
continue;
}
else
{
if(a[i]>='A'&&a[i]<='Z')
{
a[i]+=;
continue;
}
}
}
printf("%s\n",a);
}
return ;
}

Vowel Counting的更多相关文章

  1. 杭电oj 3079 Vowel Counting

    Tips:可以先将输入的字符串全部转化为小写字母,然后再将元音字母变为大写,时间复杂度O(n) #include<stdio.h> #include<string.h> #in ...

  2. HDU 3079 Vowel Counting (水题。。。判断元音)

    题意:n个字符串,如果元音就是输出大写,否则输出小写. 析:没啥可说的,只要判断AEIOU就OK了. 代码如下: #include <iostream> #include <cstd ...

  3. 杭电OJ(HDU)-ACMSteps-Chapter Two-《An Easy Task》《Buildings》《decimal system》《Vowel Counting》

    http://acm.hdu.edu.cn/game/entry/problem/list.php?chapterid=1§ionid=2 1.2.5 #include<stdio.h> ...

  4. 萌新笔记——Cardinality Estimation算法学习(二)(Linear Counting算法、最大似然估计(MLE))

    在上篇,我了解了基数的基本概念,现在进入Linear Counting算法的学习. 理解颇浅,还请大神指点! http://blog.codinglabs.org/articles/algorithm ...

  5. POJ_2386 Lake Counting (dfs 错了一个负号找了一上午)

    来之不易的2017第一发ac http://poj.org/problem?id=2386 Lake Counting Time Limit: 1000MS   Memory Limit: 65536 ...

  6. ZOJ3944 People Counting ZOJ3939 The Lucky Week (模拟)

    ZOJ3944 People Counting ZOJ3939 The Lucky Week 1.PeopleConting 题意:照片上有很多个人,用矩阵里的字符表示.一个人如下: .O. /|\ ...

  7. find out the neighbouring max D_value by counting sort in stack

    #include <stdio.h> #include <malloc.h> #define MAX_STACK 10 ; // define the node of stac ...

  8. 1004. Counting Leaves (30)

    1004. Counting Leaves (30)   A family hierarchy is usually presented by a pedigree tree. Your job is ...

  9. 6.Counting Point Mutations

    Problem Figure 2. The Hamming distance between these two strings is 7. Mismatched symbols are colore ...

随机推荐

  1. this笔记

    在js中,如果this在全局变量和函数中this指window,在在对象中至所挂载的这个对象.

  2. Java中ArrayList和LinkedList性能的比较(结果总是怪怪的,如果有不当还请指出)。

    不说废话,直接看代码: /** * @author HuYang * @date 2016年8月15日 下午3:26:43 */ public class TestJiHe { private sta ...

  3. openstack私有云布署实践【15 创建租户网络+实例】

    这里以办公网测试环境为例,   (一)创建租户demo的网络   使用admin用户 source admin-openrc.sh 创建public公网 neutron net-create 1040 ...

  4. hdu 1531 King

    首先吐槽一下这个题目的题意描述,我看了半天才明白. 下标全部都是乱标的!!!!出题者能不能规范一点下标的写法!!!! 差分约束系统 #include<cstdio> #include< ...

  5. 3-jQuery - AJAX get()

    介绍 GET 基本上用于从服务器获得(取回)数据.注释:GET 方法可能返回缓存数据. 格式 $.get(URL,callback); //必需的 URL 参数规定您希望请求的 URL. //可选的 ...

  6. Java 泛型 协变性、逆变性

    Java 泛型 协变性.逆变性 @author ixenos 摘要:协变性.协变通配符.协变数组.协变返回值 协变性.逆变性和无关性 在面向对象的计算机程序语言中,经常涉及到类型之间的转换,例如从具体 ...

  7. hdu_4918_Query on the subtree(树的分治+树状数组)

    题目链接:hdu_4918_Query on the subtree 题意: 给出一颗n个点的树,每个点有一个权值,有两种操作,一种是将某个点的权值修改为v,另一种是查询距离点u不超过d的点的权值和. ...

  8. Python之生产者&、消费者模型

    多线程中的生产者和消费者模型: 生产者和消费者可以用多线程实现,它们通过Queue队列进行通信. import time,random import Queue,threading q = Queue ...

  9. zookeeper(1)

    参考文档:zookeeper中文网 一.介绍安装 zookeeper 是一个高效的分布式协调服务,它暴露了一些公用服务,比如命名/配置/同步控制/群组服务等.我们可以使用ZK来实现一些功能,例如:达成 ...

  10. 如何安装VM Tool软件包

    在linux下,我们想把原windows操作系统下的一些文件拷入到新linux系统中,在windows下对文件(夹)进行复制,在linux下无法进行粘贴,何故?这是因为新装的linux操作系统未安装V ...