概述
**
CodeForces - 118A String Task 【水题】
**
Problem Description
Petya started to attend programming lessons. On the first lesson his task was to write a simple program. The program was supposed to do the following: in the given string, consisting if uppercase and lowercase Latin letters, it:
deletes all the vowels,
inserts a character “.” before each consonant,
replaces all uppercase consonants with corresponding lowercase ones.
Vowels are letters “A”, “O”, “Y”, “E”, “U”, “I”, and the rest are consonants. The program’s input is exactly one string, it should return the output as a single string, resulting after the program’s processing the initial string.
Help Petya cope with this easy task.
Input
The first line represents input string of Petya’s program. This string only consists of uppercase and lowercase Latin letters and its length is from 1 to 100, inclusive.
Output
Print the resulting string. It is guaranteed that this string is not empty.
Examples
Input
tour
Output
.t.r
Input
Codeforces
Output
.c.d.f.r.c.s
Input
aBAcAba
Output
.b.c.b
问题链接:https://vjudge.net/problem/CodeForces-118A
问题简述:
输入一个只含有英文大小写字母的字符串,将字符串中的元音字母删掉,在辅音字母前添加"."字符,并将大写辅音字母转换为小写字母,输出改动后的字符串。
问题分析:
我们可以先将大写字母全部转换为小写字母,再将元音字母删掉,最后在辅音字母前添加"."字符。
程序说明:
定义两个数组,一个数组保存初始字符串,一个数组保存改动后的字符串,然后用for循环逐个判断字符选择是否转换字符,转换后再将“."和转换后的字符赋给另外一个数组,最后输出改动后的字符串。注意,定义两个数组的话可能会出现RE即runtime error,将数组定义为全局变量可以解决这个问题。
AC通过的c++程序如下:
#include <stdio.h>
char a[100];
char b[100];
int main()
{ int i;
int j=0;
scanf("%s",&a);
for(i = 0; a[i] != '