Zoj 3878 Convert QWERTY to Dvorak "Good pit Simulation"

Source: Internet
Author: User

Convert QWERTY to Dvorak Time limit: 2 Seconds Memory Limit: 65536 KB

Edward, a poor copy typist, is a user of the Dvorak Layout. But now he had only a QWERTY Keyboard with a broken Caps Lock key, so Edward never presses the broken Caps Lock key. Luckily, all of the other keys in the QWERTY keyboard work well. Every day, he had 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 is in the following:

The QWERTY Layout
The Dvorak Layout
Input

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

Output

The Dvorak document.

Sample Input
JGW Gqm ANDPW a h.soav patsfk f;doenfk gq.d slpt a x,dokt vdtnsaohekjd Yspps,glu pgld; AOD yso kd;kgluz1234567890 ' [Email protected]#$%^&* ()} ']_+-=zqqwewe{[\| Anihdyf.,bt/abcdefuvwxyz
Sample Output
Hi, I ' m Abel, a Dvorak Layout user. But I ' ve only a Qwerty keyboard. The following lines is for testing:1234567890 ' [email protected]#$%^&* () +_-={}[]: ' <>,.? /\| abcdefuvwxyzaxje>ugk,qf;
Test instructions: Enter the character of the upper keyboard, and the character of the corresponding position on the bottom of the keyboard note the escape character processing
#include <stdio.h> #include <string.h> #include <algorithm> #include <math.h> #define INF 0x3f3f3f#define DD double#define MAX 110using namespace Std;char A[max];char c;char str[]= {"-=_+qwertyuiop[]qwertyuiop{ }ASDFGHJKL; ' Asdfghjkl:\ "ZXCVBNM,./ZXCVBNM<>?"}; Char s[]= {"[]{} ',. pyfgcrl/=\" <>pyfgcrl?+aoeuidhtns-aoeuidhtns_;qjkxbmwvz:qjkxbmwvz "};int main () {while    (scanf ("%c", &c)!=eof)    {    int ok=0;    int Len=strlen (str);        for (int i=0; i<len; i++)            if (str[i]==c)            {            printf ("%c", S[i]);            ok=1;}            if (!ok)            printf ("%c", c);}    return 0;}

  

Zoj 3878 Convert QWERTY to Dvorak "good pit simulation"

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.