1

tctm412 2023-09-17 10:49:54 2023-09-17 10:50:08 1

#include #include #include using namespace std; int main(){ ios::sync_with_stdio(false); map<char, char> mapKeyboard; long long iLength, i; string sInput, sAns; mapKeyboard['Q'] = 'Q'; mapKeyboard['W'] = 'Q'; mapKeyboard['E'] = 'W'; mapKeyboard['R'] = 'E'; mapKeyboard['T'] = 'R'; mapKeyboard['Y'] = 'T'; mapKeyboard['U'] = 'Y'; mapKeyboard['I'] = 'U'; mapKeyboard['O'] = 'I'; mapKeyboard['P'] = 'O'; mapKeyboard['['] = 'P'; mapKeyboard[']'] = '['; mapKeyboard['A'] = 'A'; mapKeyboard['S'] = 'A'; mapKeyboard['D'] = 'S'; mapKeyboard['F'] = 'D'; mapKeyboard['G'] = 'F'; mapKeyboard['H'] = 'G'; mapKeyboard['J'] = 'H'; mapKeyboard['K'] = 'J'; mapKeyboard['L'] = 'K'; mapKeyboard[';'] = 'L'; mapKeyboard['''] = ';'; mapKeyboard['Z'] = 'Z'; mapKeyboard['X'] = 'Z'; mapKeyboard['C'] = 'X'; mapKeyboard['V'] = 'C'; mapKeyboard['B'] = 'V'; mapKeyboard['N'] = 'B'; mapKeyboard['M'] = 'N'; mapKeyboard[','] = 'M'; mapKeyboard['.'] = ','; mapKeyboard['/'] = '.'; mapKeyboard['\']=']'; mapKeyboard[' '] = ' '; mapKeyboard[''] = ''; mapKeyboard['1'] = '`'; mapKeyboard['2'] = '1'; mapKeyboard['3'] = '2'; mapKeyboard['4'] = '3'; mapKeyboard['5'] = '4'; mapKeyboard['6'] = '5'; mapKeyboard['7'] = '6'; mapKeyboard['8'] = '7'; mapKeyboard['9'] = '8'; mapKeyboard['0'] = '9'; mapKeyboard['-'] = '0'; mapKeyboard['='] = '-'; while (getline(cin, sInput)){ iLength = sInput.length(); for (i = 0; i < iLength; ++i){ sAns += mapKeyboard[sInput[i]]; } cout << sAns << endl; sAns = ""; } return 0; }

{{ vote && vote.total.up }}