rendered paste body#include <iostream>
#include <string>
#include <cstdlib>
#include <iomanip>
using namespace std;
int main()
{
int ShiftCount;
string Text;
const string Keys[4] = {"`1234567890-=\\",
" qwertyuiop[]",
"asdfghjkl;'",
"zxcvbnm,./"};
cout << "Enter text:" << endl;
getline(cin, Text);
cout << endl << "QWERTYShift by: ";
cin >> ShiftCount;
for(string::iterator i = Text.begin() ; i != Text.end() ; i++)
{
int Row = -1;
int Key = -1;
for(int j = 0 ; j < 4 ; j++)
{
for(int k = 0 ; k != Keys[j].length() ; k++)
{
if(Keys[j][k] == *i)
{
Key = k;
Row = j;
goto loop_end;
}
}
}
loop_end:
if(Key != -1 && Row != -1)
{
Key = (Key + ShiftCount) % Keys[Row].length();
*i = Keys[Row][Key];
}
}
cout << endl << Text << endl;
system("pause");
}