我是靠谱客的博主 文艺汽车,最近开发中收集的这篇文章主要介绍【ECJTU_ACM 11级队员2012年暑假训练赛(7) - K - String Task】,觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

K - String Task
Time Limit:2000MS     Memory Limit:262144KB     64bit IO Format:%I64d & %I64u
Submit  Status  Practice  CodeForces 118A

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.

Sample Input

Input
tour
Output
.t.r
Input
Codeforces
Output
.c.d.f.r.c.s
Input
aBAcAba
Output
.b.c.b




 1 #include <iostream>
 2 using namespace std;
 3
 4 char iMap[12] = {'A', 'a', 'Y', 'y', 'E', 'e', 'U', 'u', 'O', 'o', 'I', 'i'};
 5
 6 bool iInMap(char c)
 7 {
 8
bool yes = false;
 9
int flag = 11;
10
while (!yes && flag >= 0)
11 
{
12
if (iMap[flag] == c)
13 
{
14
yes = true;
15 
}
16
flag--;
17 
}
18
return yes;
19 }
20
21 int main()
22 {
23
string s;
24
while (cin >> s)
25 
{
26
for (int i = 0; i < (int)s.length(); i++)
27 
{
28
if (!iInMap(s[i]))
29 
{
30
if (s[i] >= 'A' && s[i] <= 'Z')
31 
{
32
s[i] += 32;
33 
}
34
cout << "." << s[i];
35 
}
36 
}
37
cout << endl;
38 
}
39
return 0;
40 }
41
42 // end
43 // ism

 

 

转载于:https://www.cnblogs.com/ismdeep/archive/2012/08/05/2624410.html

最后

以上就是文艺汽车为你收集整理的【ECJTU_ACM 11级队员2012年暑假训练赛(7) - K - String Task】的全部内容,希望文章能够帮你解决【ECJTU_ACM 11级队员2012年暑假训练赛(7) - K - String Task】所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(39)

评论列表共有 0 条评论

立即
投稿
返回
顶部