-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path118A_String_Task.cpp
More file actions
58 lines (48 loc) · 1.64 KB
/
Copy path118A_String_Task.cpp
File metadata and controls
58 lines (48 loc) · 1.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/* A. String Task
time limit per test2 seconds
memory limit per test256 megabytes
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<bits/stdc++.h>
#include<string>
using namespace std;
int main(){
int i,j;
string s;
cin>>s;
string vowels = "aeiouy";
for(char &ch:s){
ch = tolower(ch);
}
string s2;
for (char ch : s) {
if (vowels.find(ch) == string::npos) { // If character is not a vowel
s2 += '.';
s2 += ch;
}
}
cout << s2 << endl;
}