Codeforces Round #271 (Div. 2) A
来源:互联网 发布:淘宝内衣买家秀木耳 编辑:程序博客网 时间:2024/05/24 02:18
A. Keyboard
题意:敲键盘的时候,如果你敲的每个键都左移或右移了一个键,会敲出另外一些内容。给出左右移后敲出的内容,让你还原原来的内容。
思路:开个字符串查找然后移位输出即可。开始还在纠结会不会出现右移后敲出q/a/z这样的情况,其实是没有的。
#include<iostream> #include<cmath> #include<cstring> #include<queue> #include<vector> #include<set>#include<algorithm> #include<string.h> #include<cstdio> using namespace std; #define ll long long #define INF 1000000char q[]="qwertyuiopasdfghjkl;zxcvbnm,./";int main(){char n;while(cin>>n){string str;cin>>str;for(int i=0;i<str.size();i++){for(int j=0;;j++){if(str[i]==q[j]){if(n=='R'){cout<<q[j-1];}else{cout<<q[j+1];}break;}}}}return 0;}
0 0
- Codeforces Round #271 (Div. 2) A
- Codeforces Round #271 (Div. 2)-A.B
- Codeforces Round #271 (Div. 2) A. Keyboard
- Codeforces Round #271 (Div. 2) --A Keyboard (暴力)
- Codeforces Round #271 (Div. 2) A B D
- Codeforces Round #131 (Div. 2) A B
- Codeforces Round #174 (Div. 2) Problem A
- Codeforces Round #173 (Div. 2) A.Bit++
- Codeforces Round #181 (Div. 2) A题
- Codeforces Round #184 (Div. 2) A题
- Codeforces Round #185 (Div. 2)--A,B
- Codeforces Round #172 (Div. 2) A题
- Codeforces Round #166 (Div. 2) A题
- Codeforces Round #132 (Div. 2) A题
- Codeforces Round #131 (Div. 2) A题
- Codeforces Round #133 (Div. 2) A题
- Codeforces Round #137 (Div. 2) A题
- Codeforces Round #138 (Div. 2) A题
- Unity3D的四种坐标系
- CF#(4D)Mysterious Present(DP)
- Linux文件系统介绍
- Metasploit Framework下的Exploit应用开发中文手册
- awk命令常用实例
- Codeforces Round #271 (Div. 2) A
- AWK详细用法
- DaVinci DM6443/6446 介绍——郑小龙
- CentOS 6.5安装TortoiseSVN svn 客户端
- STM32如何使用内部时钟源当系统时钟
- struts1中使用quartz
- maketrans()函数
- shell编程
- 期望DP