/*
模拟:手敲map一一映射,累!
除了忘记读入字符串不能用gets用getline外还是很顺利的AC了:)
*/
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <string>
#include <map>
#include <set>
#include <queue>
#include <vector>
using namespace std; const int MAXN = 1e2 + ;
const int INF = 0x3f3f3f3f;
map<char, char> m;
string s; void solve(void)
{
m['~'] = '~'; m['`'] = '`';
m['!'] = '!'; m[''] = '';
m['@'] = '@'; m[''] = '';
m['#'] = '#'; m[''] = '';
m['$'] = '$'; m[''] = '';
m['%'] = '%'; m[''] = '';
m['^'] = '^'; m[''] = '';
m['&'] = '&'; m[''] = '';
m['*'] = '*'; m[''] = '';
m['('] = '('; m[''] = '';
m[')'] = ')'; m[''] = '';
m['_'] = '{'; m['-'] = '[';
m['+'] = '}'; m['='] = ']';
m['Q'] = '"'; m['q'] = '\'';
m['W'] = '<'; m['w'] = ',';
m['E'] = '>'; m['e'] = '.';
m['R'] = 'P'; m['r'] = 'p';
m['T'] = 'Y'; m['t'] = 'y';
m['Y'] = 'F'; m['y'] = 'f';
m['U'] = 'G'; m['u'] = 'g';
m['I'] = 'C'; m['i'] = 'c';
m['O'] = 'R'; m['o'] = 'r';
m['P'] = 'L'; m['p'] = 'l';
m['{'] = '?'; m['['] = '/';
m['}'] = '+'; m[']'] = '=';
m['|'] = '|'; m['\\'] = '\\';
m['A'] = 'A'; m['a'] = 'a';
m['S'] = 'O'; m['s'] = 'o';
m['D'] = 'E'; m['d'] = 'e';
m['F'] = 'U'; m['f'] = 'u';
m['G'] = 'I'; m['g'] = 'i';
m['H'] = 'D'; m['h'] = 'd';
m['J'] = 'H'; m['j'] = 'h';
m['K'] = 'T'; m['k'] = 't';
m['L'] = 'N'; m['l'] = 'n';
m[':'] = 'S'; m[';'] = 's';
m['"'] = '_'; m['\''] = '-';
m['Z'] = ':'; m['z'] = ';';
m['X'] = 'Q'; m['x'] = 'q';
m['C'] = 'J'; m['c'] = 'j';
m['V'] = 'K'; m['v'] = 'k';
m['B'] = 'X'; m['b'] = 'x';
m['N'] = 'B'; m['n'] = 'b';
m['M'] = 'M'; m['m'] = 'm';
m['<'] = 'W'; m[','] = 'w';
m['>'] = 'V'; m['.'] = 'v';
m['?'] = 'Z'; m['/'] = 'z';
m[' '] = ' ';
} int main(void) //ZOJ 3878 Convert QWERTY to Dvorak
{
//freopen ("J.in", "r", stdin); solve ();
while (getline (cin, s))
{
for (int i=; s[i]; ++i)
cout << m[s[i]];
cout << endl;
} return ;
} /*
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 <stdio.h>
#include <string.h>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <vector>
#include <math.h>
#include <algorithm>
using namespace std;
#define ls 2*i
#define rs 2*i+1
#define up(i,x,y) for(i=x;i<=y;i++)
#define down(i,x,y) for(i=x;i>=y;i--)
#define mem(a,x) memset(a,x,sizeof(a))
#define w(a) while(a)
#define LL long long
const double pi = acos(-1.0);
#define Len 20005
#define mod 19999997
const int INF = 0x3f3f3f3f; char s1[]= {"-=_+qwertyuiop[]QWERTYUIOP{}asdfghjkl;'ASDFGHJKL:\"zxcvbnm,./ZXCVBNM<>?"};
char s2[]= {"[]{}',.pyfgcrl/=\"<>PYFGCRL?+aoeuidhtns-AOEUIDHTNS_;qjkxbmwvz:QJKXBMWVZ"};
char c; char print(char c)
{
for(int i=; s1[i]; i++)
if(s1[i]==c)
return s2[i];
return c;
}
int main()
{
w(~scanf("%c",&c))
printf("%c",print(c)); return ;
}
网上题解,两行,给跪了!