codeforces 118A String Task(字符串水题)
来源:互联网 发布:js 父窗口 span 编辑:程序博客网 时间:2024/05/17 05:10
点击打开题目
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 from1 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.h>using namespace std;int main(){ int k,i,t; char c[101],s[101]; while(cin>>c) { k=strlen(c); for(i=0,t=0;i<k;i++) { if(!(c[i]=='A'||c[i]=='a'||c[i]=='O'||c[i]=='o'||c[i]=='Y'||c[i]=='y'||c[i]=='U'||c[i]=='u'||c[i]=='I'||c[i]=='i'||c[i]=='E'||c[i]=='e')) s[t++]=c[i]; } for(i=0;i<t;i++) { cout<<"."; if(s[i]>='A'&&s[i]<='Z') cout<<char(s[i]+32); else cout<<s[i]; } cout<<endl; memset(c,101,sizeof(c[0])); } return 0;}
- codeforces 118A String Task(字符串水题)
- CodeForces 118 A.String Task(水~)
- CodeForces 118A. String Task
- codeforces 118A String Task
- 【CodeForces】A. String Task
- Problem--118A--Codeforces--String Task
- Codeforces Beta Round #89 (Div. 2) / 118A String Task(字符串操作)
- 118A - String Task
- 118A String Task
- CF - 118A - String Task
- CF: 118A.String Task
- CF 118A string task
- 【Educational Codeforces Round 1B】【字符串平移 水题】Queries on a String 字符串平移水题
- A. String Task
- Codeforces 558E A Simple Task (简单题)
- codeforces 56D Changing a String 区间dp,字符串
- Codeforces Gym 100325A String Decomposition 字符串DP
- codeforces 96A (字符串模拟水题)
- MySQL存储引擎MyISAM和InnoDB的区别及mysql优化
- Windows下查看LINUX ext2/ext3格式的三种常用方法(图解)
- Action中result的Types 属性
- JZP Set
- 日期类
- codeforces 118A String Task(字符串水题)
- Opencv中HOG+SVM进行行人检测
- 关于C的预编译 宏定义 的一些使用
- 坐标移动
- B-tree/B+tree/B*tree
- 8大常见蔬果助准妈妈夏季养生
- 使用sublime text2如何新建文件快速生成HTML头部信息?
- 互联网时代的社会语言学:基于SNS的文本数据挖掘(转载)
- 胜多负少的功夫大使馆