-
Notifications
You must be signed in to change notification settings - Fork 0
/
10222.cpp
44 lines (42 loc) · 814 Bytes
/
10222.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
44
/*
10222 - Decode the Mad man
*/
#include<bits/stdc++.h>
using namespace std;
int main()
{
int i,j,len;
char text[1000],n;
char ar[]="`1234567890-=qwertyuiop[]asdfghjkl;'\\zxcvbnm,./";
gets(text);
len=strlen(text);
for(i=0; i<len; i++)
{
n=tolower(text[i]);
if(n!='`'&& n!='q'&&n!='a'&&n!='z'
&&n!='w'&&n!='s'&&n!='x')
{
for(j=0; j<=46; j++)
{
if(n==' ')
{
printf(" ");
break;
}
if(n==ar[j])
{
printf("%c",ar[j-2]);
break;
}
}
}
}
cout<<endl;
return 0;
}
/*
Sample Input
k[r dyt I[o
Sample Output
how are you
*/