Time Limit:2000MS     Memory Limit:65536KB     64bit IO Format:%lld & %llu

Description

Edward, a poor copy typist, is a user of the Dvorak Layout. But now he has only a QWERTY Keyboard with a broken Caps Lock key, so Edward never presses the broken Caps Lock key. Luckily, all the other keys on the QWERTY keyboard work well. Every day, he has a lot of documents to type. Thus he needs a converter to translate QWERTY into Dvorak. Can you help him?

The QWERTY Layout and the Dvorak Layout are in the following:

The QWERTY Layout

The Dvorak Layout

Input

A QWERTY document Edward typed. The document has no more than 100 kibibytes. And there are no invalid characters in the document.

Output

The Dvorak document.

Sample Input

Jgw Gqm Andpw a H.soav Patsfk f;doe
Nfk Gq.d slpt a X,dokt vdtnsaohe
Kjd yspps,glu pgld; aod yso kd;kgluZ
1234567890
`~!@#$%^&*()}"']_+-=ZQqWEwe{[\|
ANIHDYf.,bt/
ABCDEFuvwxyz

Sample Output

Hi, I'm Abel, a Dvorak Layout user.
But I've only a Qwerty keyboard.
The following lines are for testing:
1234567890
`~!@#$%^&*()+_-={}[]:"'<>,.?/\|
ABCDEFuvwxyz
AXJE>Ugk,qf;
#include<iostream>
#include<algorithm>
#include<map>
using namespace std;
map<char,char>M;
void init(){
M['-']='['; M['A']='A'; M['X']='Q';
M['_']='{'; M['a']='a'; M['x']='q';
M['+']='}'; M['s']='o'; M['C']='J';
M['=']=']'; M['S']='O'; M['c']='j';
M['Q']='"'; M['D']='E'; M['V']='K';
M['q']='\''; M['d']='e'; M['v']='k';
M['W']='<'; M['F']='U'; M['B']='X';
M['w']=','; M['f']='u'; M['b']='x';
M['E']='>'; M['G']='I'; M['N']='B';
M['e']='.'; M['g']='i'; M['n']='b';
M['R']='P'; M['H']='D'; M['M']='M';
M['r']='p'; M['h']='d'; M['m']='m';
M['T']='Y'; M['j']='h'; M['<']='W';
M['t']='y'; M['K']='T'; M[',']='w';
M['Y']='F'; M['J']='H'; M['>']='V';
M['y']='f'; M['k']='t'; M['.']='v';
M['U']='G'; M['L']='N'; M['?']='Z';
M['u']='g'; M['l']='n'; M['/']='z';
M['I']='C'; M[':']='S'; M['{']='?';
M['i']='c'; M[';']='s'; M['[']='/';
M['O']='R'; M['"']='_'; M['}']='+';
M['o']='r'; M['\'']='-'; M[']']='=';
M['P']='L'; M['Z']=':';
M['p']='l'; M['z']=';';
}
int main(){
init();
string str;
while(getline(cin,str)){
for(int i=;i<str.length();i++){
if(M.count(str[i]))cout<<M[str[i]];
else cout<<str[i];
}
cout<<endl;
}
return ;
}

Convert QWERTY to Dvorak的更多相关文章

  1. 模拟 ZOJ 3878 Convert QWERTY to Dvorak

    题目传送门 /* 模拟:手敲map一一映射,累! 除了忘记读入字符串不能用gets用getline外还是很顺利的AC了:) */ #include <cstdio> #include &l ...

  2. zoj The 12th Zhejiang Provincial Collegiate Programming Contest Convert QWERTY to Dvorak

    http://acm.zju.edu.cn/onlinejudge/showContestProblem.do?problemId=5502  The 12th Zhejiang Provincial ...

  3. zoj 3878 Convert QWERTY to Dvorak【好坑的模拟】

    Convert QWERTY to Dvorak Time Limit: 2 Seconds      Memory Limit: 65536 KB Edward, a poor copy typis ...

  4. (字符串 键盘转换)Convert QWERTY to Dvorak -- zoj -- 5526

    链接: http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=5526 Time Limit: 2 Seconds      Memor ...

  5. ACM学习历程—ZOJ3878 Convert QWERTY to Dvorak(Hash && 模拟)

    Description Edward, a poor copy typist, is a user of the Dvorak Layout. But now he has only a QWERTY ...

  6. ZOJ Problem Set - 3878 Convert QWERTY to Dvorak

    题目链接: http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3878 /* 问题 很有意思的一道题目,纯模拟,注意细节和最后一 ...

  7. 说说qwerty、dvorak、colemak三种键盘布局

    [qwerty布局] qwerty布局大家应该都很熟悉了,全世界最普及的键盘布局. 截止到去年接触并使用dvorak布局之前,我使用了十几年qwerty布局,在http://speedtest.10f ...

  8. 140 - The 12th Zhejiang Provincial Collegiate Programming Contest(第三部分)

    Earthstone Keeper Time Limit: 4 Seconds      Memory Limit: 65536 KB Earthstone Keeper is a famous ro ...

  9. gnome设置dvorak键盘布局

    若桌面环境为gnome,设置Dvorak键盘程序员布局很简单.系统设置 -> 键盘 -> 布局设置 -> 点击"+" ->选择"英语(适合程序员的 ...

随机推荐

  1. VS Code开发调试ASP.NET Core 1.0

    VS Code开发调试ASP.NET Core 1.0 使用VS Code开发调试ASP.NET Core 1.0,微软在今天凌晨发布了.NET Core 1.0,ASP.NET Core 1.0 与 ...

  2. php unset 数组陷阱

    我们删除一个array, unset($arr); 想删除某个元素 unsert($arr[i]) 一个陷阱是: unset() 函数允许删除数组中的某个键.但要注意数组将不会重建索引.如果需要删除后 ...

  3. Codeforces 331A2 - Oh Sweet Beaverette (70 points)

    贪心搞就行,用map记录每个数出现的下标,每次都取首尾两个.将中间权值为负的删掉后取sum值最大的就行. #include<iostream> #include<algorithm& ...

  4. 用shell脚本爬取网页信息

    有个小需求,就是爬取一个小网站一些网页里的某些信息,url是带序号的类似的,不需要写真正的spider,网页内容也是差不多的 需要取出网页中<h1></h1>中间的字符串,而且 ...

  5. PHP - 发送短信

    1.购买服务 我购买的是在百度进行推广的API服务.按照要求进行购买就好,之后获取自己的apikey. 2.将提供的代码修改后集成到项目中: <?php /** * * * 发送短信 * * * ...

  6. css之display:inline-block与float区别(可以尝试用一下)

    HTML的元素有多种display属性,比较常见的有display:none; display:block; display:inline和display:inline-block;等.详细可参阅W3 ...

  7. Http方式获取网络数据

    通过以下代码可以根据网址获取网页的html数据,安卓中获取网络数据的时候会用到,而且会用Java中的sax方式解析获取到数据.(sax解析主要是解析xml)具体代码如下: package com.wy ...

  8. Cubieboard4卡片式电脑

    Cubieboard4 also named CC-A80, is a open source mini PC or single board computer which has ultra-pow ...

  9. 基于visual Studio2013解决C语言竞赛题之0614递归大元素

     题目 解决代码及点评 /************************************************************************/ /* 14. 编一个程 ...

  10. win7系统远程连接其它计算机,并且向远程机传输文件

    首先,打开开始菜单,在程序自带的 “附件“ 中找到 "远程桌面连接"并打开,出现远程桌面对话框: 其次,在对话框左下角点击“选项”,选择“本地资源对话框”,在本地设备和资源下点击“ ...