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. AFNetWorking 提交 NSArray 类型参数 取不到值的解决办法

    在使用AFNWorking 提交参数的时候, 其中包含NSArray类型的参数, 但是后台可以接收到普通int, string 类型的参数,就是接收不到array类型的, google后发现原来AFN ...

  2. 基于visual Studio2013解决算法导论之018栈实现(基于链表)

     题目 用链表实现栈 解决代码及点评 #include <stdio.h> #include <stdlib.h> #include <time.h> #in ...

  3. CMake初步(2)

    转自:<你所不知的OSG>第一章:CMake初步(2) http://bbs.osgchina.org/forum.php?mod=viewthread&tid=1229& ...

  4. PS图片

    第二次练习PS,不知道找什么图片,就这么做着吧.然后自己学习了下动画制作,但是中间有些问题,需要再研究研究. 像 CS6中新建蒙版文档,画出的图形单位是厘米,怎么改为像素?(答案看后续博客....)

  5. arm: 使用结构体操作寄存器

    使用结构体操作寄存器: //寄存器赋值和取值的时候,要注意寄存器的长度,有的寄存器的值只有8位. //还要注意,使用volatile修饰寄存器变量.volatile 参考http://www.cnbl ...

  6. BZOJ 1085: [SCOI2005]骑士精神( IDDFS + A* )

    一开始写了个 BFS 然后就 T 了... 这道题是迭代加深搜索 + A* -------------------------------------------------------------- ...

  7. Javascript DOM 01 基础篇

    DOM基础   DOM是什么        答:文件对象模型(Document Object Model,简称DOM),DOM可以以一种独立于平台和语言的方式访问和修改一个文档的内容和结构!来自网络 ...

  8. WPF4字体改善

    原文 WPF4字体改善 WPF4对字体渲染做了很大的改善,增加了TextOptions属性,该属性可以设置TextFormattingMode,TextRenderingMode,TextHintin ...

  9. solr 从零学习开始

    2010-10 目 录 1 1.1 1.2 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.3 1.3.1 1.3.2 1.4 1.4.1 1.4.2 1.4. ...

  10. (SQL SERVER) (ORACLE) (ACCESS)(POSTGRE SQL)四种数据库操作C#代码

    将对这四种数据库的操作封装到了2个类中可以拷贝过去直接使用. public sealed class OleDbClass { #region private utility methods & ...