CodeForces
来源:互联网 发布:查询linux ipv6 arp 编辑:程序博客网 时间:2024/06/05 21:01
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.
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.
Print the resulting string. It is guaranteed that this string is not empty.
tour
.t.r
Codeforces
.c.d.f.r.c.s
aBAcAba
.b.c.b
#include<iostream>#include<string>using namespace std;int main(){ string s; while(cin>>s) { for(int i=0;i<s.length();i++) { if(s[i]=='a'||s[i]=='A'||s[i]=='o'||s[i]=='O'||s[i]=='y'||s[i]=='Y'||s[i]=='e'||s[i]=='E'||s[i]=='u'||s[i]=='U'||s[i]=='i'||s[i]=='I') { continue; } else { if(s[i]>='A'&&s[i]<='Z') { s[i]=tolower(s[i]); } cout<<"."<<s[i]; } } cout<<endl; }}
- codeforces~~~
- Codeforces
- codeforces
- Codeforces
- codeforces
- codeforces
- Codeforces
- Codeforces
- CodeForces
- CodeForces
- CodeForces
- CodeForces
- CodeForces
- Codeforces
- Codeforces
- Codeforces
- Codeforces
- Codeforces
- 一张图读懂PHP YII应用的工作流程
- LeetCode463 island perimeter
- nginx sticky模块介绍
- Leetcode-Implement strStr()
- Gradle--项目范围设置额外属性
- CodeForces
- es6数值扩展(四)
- 说说Java里的equals(上)
- 【大数据 hadoop】大数据框架Hadoop主要模块介绍
- 安卓中关于Handler机制的浅谈
- 插件化基础之Java世界
- Visual Assist X中文注释为提醒注释错误
- django 删除数据库表后重新同步
- 获取select中选中option的值