我是靠谱客的博主 隐形裙子,这篇文章主要介绍CodeForces 118 A.String Task(水~),现在分享给大家,希望可以做个参考。

Description

给出一个只有大小写字母的字符串,做如下处理:

1.删除所有元音字母(A,O,Y,E,U,I)

2.在每个辅音字母前加一个.

3.把所有大写辅音字母变成小写

Input

一个长度不超过100的字符串

Output

输出处理后的字符串

Sample Input

tour

Sample Output

.t.r

Solution

水题

Code

复制代码
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
#include<cstdio> #include<iostream> #include<cstring> #include<algorithm> #include<cmath> #include<vector> #include<queue> #include<map> #include<set> #include<ctime> using namespace std; typedef long long ll; typedef pair<int,int>P; const int INF=0x3f3f3f3f,maxn=100001; char s[maxn]; int check(char c) { if(c>='a'&&c<='z')c=c-'a'+'A'; if(c=='A'||c=='O'||c=='Y'||c=='E'||c=='U'||c=='I')return 1; return 0; } char deal(char c) { if(c>='A'&&c<='Z')return c-'A'+'a'; return c; } int main() { scanf("%s",s); int n=strlen(s); for(int i=0;i<n;i++) { if(check(s[i]))continue; s[i]=deal(s[i]); printf(".%c",s[i]); } printf("n"); return 0; }

最后

以上就是隐形裙子最近收集整理的关于CodeForces 118 A.String Task(水~)的全部内容,更多相关CodeForces内容请搜索靠谱客的其他文章。

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

评论列表共有 0 条评论

立即
投稿
返回
顶部