-
Notifications
You must be signed in to change notification settings - Fork 1
/
A.cpp
43 lines (37 loc) · 910 Bytes
/
A.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#include <bits/stdc++.h>
using namespace std;
int main()
{
char R[] = "snvfrghjokl;,mp[wtdyibecux";
char L[] = " vxswdfguhjknbio earycqzt ";
char cmd;
char a[120] ;
scanf("%c", &cmd);
scanf("%s", a);
if(cmd == 'R') {
for(int i = 0; a[i] != '\0'; i++) {
if(a[i] == ';')
printf("l");
else if(a[i] == '/')
printf(".");
else if(a[i] == '.')
printf(",");
else if(a[i] == ',')
printf("m");
else
printf("%c", L[a[i] - 97]);
}
}
if(cmd == 'L') {
for(int i = 0; a[i] != '\0'; i++) {
if(a[i] == '.')
printf("/");
else if(a[i] == ',')
printf(".");
else
printf("%c", R[a[i] - 97]);
}
}
printf("\n");
return 0;
}