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 <cstdio>
#include <cstring>
using namespace std;
int main()
{
int l,i,j,k,s;
char a[100008];
while(gets(a))
{
l=strlen(a);
for(i=0;i<l;i++)
{
switch(a[i])
{
case ' ':cout<<" ";break;
case '0':cout<<"0";break;
case '1':cout<<"1";break;
case '2':cout<<"2";break;
case '3':cout<<"3";break;
case '4':cout<<"4";break;
case '5':cout<<"5";break;
case '6':cout<<"6";break;
case '7':cout<<"7";break;
case '8':cout<<"8";break;
case '9':cout<<"9";break;
case '~':cout<<"~";break;
case '`':cout<<"`";break;
case '!':cout<<"!";break;
case '@':cout<<"@";break;
case '#':cout<<"#";break;
case '$':cout<<"$";break;
case '%':cout<<"%";break;
case '^':cout<<"^";break;
case '&':cout<<"&";break;
case '*':cout<<"*";break;
case '(':cout<<"(";break;
case ')':cout<<")";break;
case '_':cout<<"{";break;
case '-':cout<<"[";break;
case '+':cout<<"}";break;
case '=':cout<<"]";break;
case '|':cout<<"|";break;
case '\\':cout<<"\\";break;
case 'Q':cout<<"\"";break;
case 'W':cout<<"<";break;
case 'E':cout<<">";break;
case 'R':cout<<"P";break;
case 'T':cout<<"Y";break;
case 'Y':cout<<"F";break;
case 'U':cout<<"G";break;
case 'I':cout<<"C";break;
case 'O':cout<<"R";break;
case 'P':cout<<"L";break;
case 'q':cout<<"'";break;
case 'w':cout<<",";break;
case 'e':cout<<".";break;
case 'r':cout<<"p";break;
case 't':cout<<"y";break;
case 'y':cout<<"f";break;
case 'u':cout<<"g";break;
case 'i':cout<<"c";break;
case 'o':cout<<"r";break;
case 'p':cout<<"l";break;
case 'A':cout<<"A";break;
case 'S':cout<<"O";break;
case 'D':cout<<"E";break;
case 'F':cout<<"U";break;
case 'G':cout<<"I";break;
case 'H':cout<<"D";break;
case 'J':cout<<"H";break;
case 'K':cout<<"T";break;
case 'L':cout<<"N";break;
case ':':cout<<"S";break;
case '"':cout<<"_";break;
case 'a':cout<<"a";break;
case 's':cout<<"o";break;
case 'd':cout<<"e";break;
case 'f':cout<<"u";break;
case 'g':cout<<"i";break;
case 'h':cout<<"d";break;
case 'j':cout<<"h";break;
case 'k':cout<<"t";break;
case 'l':cout<<"n";break;
case ';':cout<<"s";break;
case '\'':cout<<"-";break;
case 'Z':cout<<":";break;
case 'X':cout<<"Q";break;
case 'C':cout<<"J";break;
case 'V':cout<<"K";break;
case 'B':cout<<"X";break;
case 'N':cout<<"B";break;
case 'M':cout<<"M";break;
case '<':cout<<"W";break;
case '>':cout<<"V";break;
case '?':cout<<"Z";break;
case 'z':cout<<";";break;
case 'x':cout<<"q";break;
case 'c':cout<<"j";break;
case 'v':cout<<"k";break;
case 'b':cout<<"x";break;
case 'n':cout<<"b";break;
case 'm':cout<<"m";break;
case ',':cout<<"w";break;
case '.':cout<<"v";break;
case '/':cout<<"z";break;
case '{':cout<<"?";break;
case '[':cout<<"/";break;
case '}':cout<<"+";break;
case ']':cout<<"=";break;
}
}cout<<endl;
}
return 0;
}