1. 程式人生 > >String Task

String Task

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

題解:就是講母音的幾個字母跳過然後把大寫的字母轉換成小寫的…我認為首先把所有大小寫字母轉換後再用條件語句將非母音字母輸出就行了這樣可以省略對母音大寫字母的挑選

我的程式碼:

#include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
#define maxn 105
int main()
{
char a[maxn];
while(cin>>a)
{
for(int i=0;i<strlen(a);i++)
{
if(a[i]>=65&&a[i]<=90) a[i]=a[i]+32;
if(a[i]!='a'&&a[i]!='e'&&a[i]!='i'&&a[i]!='o'&&a[i]!='u'&&a[i]!='y')
cout<<"."<<a[i];
}
}
return 0;
}