CodeForces 118 A.String Task(水~)
来源:互联网 发布:npm 淘宝镜像安装教程 编辑:程序博客网 时间:2024/05/17 22:18
Description
给出一个只有大小写字母的字符串,做如下处理:
1.删除所有元音字母(A,O,Y,E,U,I)
2.在每个辅音字母前加一个.
3.把所有大写辅音字母变成小写
Input
一个长度不超过100的字符串
Output
输出处理后的字符串
Sample Input
tour
Sample Output
.t.r
Solution
水题
Code
#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;}
阅读全文
0 0
- CodeForces 118 A.String Task(水~)
- CodeForces 118A. String Task
- codeforces 118A String Task
- 【CodeForces】A. String Task
- codeforces 118A String Task(字符串水题)
- Problem--118A--Codeforces--String Task
- 118A - String Task
- 118A String Task
- CF - 118A - String Task
- CF: 118A.String Task
- CF 118A string task
- Codeforces Beta Round #89 (Div. 2) / 118A String Task(字符串操作)
- A. String Task
- CodeForces 623 A. Graph and String(水~)
- CodeForces 733 A.Grasshopper And the String(水~)
- 【CodeForces 778A】String Game(二分)
- Codeforces 778A String Game(二分)
- codeforces 8a(string的操作)
- POJ1182食物链
- 安装mysql
- 【hpu oj 1019 985的买饮料难题 [数学、DP]】
- POJ2502 subway(spfa)
- <8>——String to Integer (atoi)
- CodeForces 118 A.String Task(水~)
- codeforces815aKarenAndGames解题报告
- C++的Lambda表达式
- 详解C++11的Lambda表达式
- Intellij Idea 创建Web项目入门(非Maven项目)
- cmd MySQL登录
- scala之映射和元祖
- vim常用命令
- 十字架(百度2017秋招真题)