Advertisement
Guest User

Untitled

a guest
Aug 31st, 2017
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. #include <vector>
  4. using namespace std;
  5. int main()
  6. {
  7. vector<string> arr = { "!@#$%^&*()_+",
  8. "QWERTYUIOP{}|",
  9. "ASDFGHJKL:\"",
  10. "ZXCVBNM<>?",
  11. "1234567890-=",
  12. "qwertyuioP[]'\'",
  13. "asdfghjkL;'",
  14. "zxcvbnM,./"};
  15. string row;
  16. while(getline(cin,row))
  17. {
  18. if (row.empty())
  19. break;
  20. for(int i = 0; i < row.size(); i++)
  21. {
  22. for( string s : arr )
  23. {
  24. for(int j = 0; j < s.size(); j++)
  25. {
  26. if ( s.at(j) == row.at(i) )
  27. row[i] = s.at(j-1);
  28. }
  29. }
  30. }
  31. cout << row << endl;
  32. }
  33.  
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement