Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /************************
- ** Solution by daun **
- ***********************/
- #include <bits/stdc++.h>
- using namespace std;
- const int N = 200005;
- const int INF = 4127;
- const int mod = 475;
- string a1 = "qwertyuiop", a2 = "asdfghjkl;", a3 = "zxcvbnm,./";
- int main() {
- string n, s;
- cin >> n >> s;
- if (n[0] == 'R') {
- for (int i = 0; i < s.size(); i++) {
- if (a1.find(s[i]) != string::npos) {
- cout << a1[a1.find(s[i]) - 1];
- continue;
- }
- if (a2.find(s[i]) != string::npos) {
- cout << a2[a2.find(s[i]) - 1];
- continue;
- }
- if (a3.find(s[i]) != string::npos) {
- cout << a3[a3.find(s[i]) - 1];
- }
- }
- } else {
- for (int i = 0; i < s.size(); i++) {
- if (a1.find(s[i]) != string::npos) {
- cout << a1[a1.find(s[i]) + 1];
- continue;
- }
- if (a2.find(s[i]) != string::npos) {
- cout << a2[a2.find(s[i]) + 1];
- continue;
- }
- if (a3.find(s[i]) != string::npos) {
- cout << a3[a3.find(s[i]) + 1];
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement