Advertisement
Guest User

Untitled

a guest
Dec 24th, 2017
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.64 KB | None | 0 0
  1. #include <iostream>
  2. #include <map>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8.     string keyboard = "qwertyuiopasdfghjkl;zxcvbnm,./";
  9.     string strochka = "t";
  10.     string kosara = "g";
  11.     // keyboard[keyboard.find("w")] - Выводит ID
  12.     // cout << keyboard[keyboard.find("s") - 1];
  13.     cin >> kosara;
  14.     cin >> strochka;
  15.    
  16.     if (kosara == "R"){
  17.     for(string::size_type i = 0; i < strochka.size(); ++i) {
  18.         cout << keyboard[keyboard.find(strochka[i]) - 1];
  19.     }
  20.     }
  21.     else{
  22.         for(string::size_type i = 0; i < strochka.size(); ++i) {
  23.         cout << keyboard[keyboard.find(strochka[i]) + 1];
  24.     }
  25.     }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement