Our good friend Mole is trying to code a big message. He is typing on an unusual keyboard with characters arranged in following way:

qwertyuiop
asdfghjkl;
zxcvbnm,./

Unfortunately Mole is blind, so sometimes it is problem for him to put his hands accurately. He accidentally moved both his hands with one position to the left or to the right. That means that now he presses not a button he wants, but one neighboring button (left or right, as specified in input).

We have a sequence of characters he has typed and we want to find the original message.

Input

First line of the input contains one letter describing direction of shifting ('L' or 'R' respectively for left or right).

Second line contains a sequence of characters written by Mole. The size of this sequence will be no more than 100. Sequence contains only symbols that appear on Mole's keyboard. It doesn't contain spaces as there is no space on Mole's keyboard.

It is guaranteed that even though Mole hands are moved, he is still pressing buttons on keyboard and not hitting outside it.

Output

Print a line that contains the original message.

Examples
input
R
s;;upimrrfod;pbr
output
allyouneedislove

题解:直接模拟

 #include <iostream>
#include <algorithm>
#include <cstring>
#include <cstdio>
#include <vector>
#include <cstdlib>
#include <iomanip>
#include <cmath>
#include <ctime>
#include <map>
#include <set>
using namespace std;
#define lowbit(x) (x&(-x))
#define max(x,y) (x>y?x:y)
#define min(x,y) (x<y?x:y)
#define MAX 100000000000000000
#define MOD 1000000007
#define pi acos(-1.0)
#define ei exp(1)
#define PI 3.141592653589793238462
#define INF 0x3f3f3f3f3f
#define mem(a) (memset(a,0,sizeof(a)))
typedef long long ll;
const int N=;
const int mod=1e9+;
int a[];
int main()
{
string a="qwertyuiopasdfghjkl;zxcvbnm,./";
char b,c[];
scanf("%c%s",&b,c);
for(int j=;j<strlen(c);j++)
for(int i=;i<a.size();i++){
if(a[i]==c[j]){
if(b=='L')
printf("%c",a[i+]);
else
printf("%c",a[i-]);
break;
}
}
return ;
}

Codeforce 474A - Keyboard的更多相关文章

  1. Codeforces 474A Keyboard (水

    题目链接:点击打开链接 键盘移位了,问输出相应的字母 #include <cstdio> #include <cstring> char a[105]; char b[3][1 ...

  2. CodeForces 474A Keyboard (水题)

    题意:给定一个键盘,然后一行字母,和一个字符,代表把那一行字母在键盘上左移还是右移一位. 析:没什么好说的,直接暴力就好. 代码如下: #include<bits/stdc++.h> us ...

  3. [CodeForce 801A] Vicious Keyboard

    题目链接:http://codeforces.com/problemset/problem/801/A 思路:题目中字符串的长度最长100个字符,所以,可以考虑用暴力,先遍历一遍匹配"VK& ...

  4. Fedora 22中的Locale and Keyboard Configuration

    Introduction The system locale specifies the language settings of system services and user interface ...

  5. android:configChanges="keyboard|keyboardHidden|orientation|screenSize"

    <activity android:name="xxxActivity" android:configChanges="keyboard|keyboardHidde ...

  6. USB Keyboard Recorder

    catalogue . 引言 . Device Class Definition for Human Interface Devices (HID) . USB HID Report Descript ...

  7. imx6 matrix keyboard

    imx6需要添加4x4的矩阵键盘.本文记录添加方法. 参考链接 http://processors.wiki.ti.com/index.php/TI-Android-JB-PortingGuide h ...

  8. Codeforces Round #389 Div.2 B. Santa Claus and Keyboard Check

    time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standa ...

  9. UVa 11998 Broken Keyboard (数组模拟链表问题)

    题目链接: 传送门 Broken Keyboard #include<bits/stdc++.h> using namespace std; char str[100010]; int m ...

随机推荐

  1. c#音乐播放器

    using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; usin ...

  2. 新手必看:PyCharm安装教程,Python开发者的有力工具

    PyCharm是由JetBrains打造的一款Python IDE,VS2010的重构插件Resharper就是出自JetBrains之手. 同时支持Google App Engine,PyCharm ...

  3. C#建立自己的测试用例系统

    引言 很多时候,需要对类中的方法进行一些测试,来判断是否能按要求输出预期的结果. C#提供了快速创建单元测试的方法,但单元测试不仅速度慢不方便,大量的单元测试还会拖慢项目的启动速度. 所以决定自己搞个 ...

  4. Win环境下安装vue及运行vue开发的前端项目

    vue安装及配置 首先下载node.js要求版本在8.9以上        官网:https://nodejs.org/zh-cn/ 下载完可检查在windows任务命令行里输入node -v 使用淘 ...

  5. myeclipce 按 Alt + / 代码提示无法感应自己定义的类 解决方案

    解决方案:如图把这些选项全部都勾选即可.(注意 :需先排除是不是快捷键冲突,我遇到的问题是Alt+/可以提示jdk内置的对象和方法,但是无法提示自定义的类和方法.如Alt+/无法提示任何信息 需重新设 ...

  6. mybatis配置---> mybatisConfig.xml 配置加接数据源

    mybatisConfig.xml 配置主要作用是连接数据源配置的前提是在完成mybatis的jar包基础之上进行的同时要确保数据用户名和密码是否正确 一:密码写在 mybatisConfig.xml ...

  7. Python爬虫连载9-JS加密之“盐”​、ajax请求

    一.JS加密之“盐”​ 1.salt属性“盐":多用于密码学,比如我们的银行卡是六位密码,但是实际上在银行的系统里,我们输入密码后,会给原始的密码添加若干字符,形成更加难以破解的密码.这个过 ...

  8. Upx 压缩go编译的程序 frp

    1. frp 程序占用大 .路由器 不够空间 2. UPX 下载地址       https://github.com/upx/upx/releases/ 3.  压缩命令  upx.exe -9 C ...

  9. LAMP搭建随笔

    前言 这是我第一次在写博客,里面记录了我配置LAMP遇到的各种各样的细节,也许表述不够准确,希望大佬给于批评指正 环境 OS Ubuntu server 18.04.3 远程连接软件 cmder 文件 ...

  10. 纪中17日T2 2322. capacitor

    2322. capacitor (File IO): input:capacitor.in output:capacitor.out 题目描述 输入 输出 样例输入 样例输出 数据范围限制 Solut ...