# UVA 10222 Decode the Mad man
## 題目連結 [UVA 10222](https://vjudge.net/problem/UVA-10222)
### 題目內容
Once in BUET, an old professor had gone completely mad. He started talking with some peculiar words. Nobody could realize his speech and lectures. Finally the BUET authority fall in great trouble.
There was no way left to keep that man working in university. Suddenly a student (definitely he was a registered author at UVA ACM Chapter and hold a good rank on 24 hour-Online Judge) created a program that was able to decode that professor’s speech. After his invention, everyone got comfort again and that old teacher started his everyday works as before. So, if you ever visit BUET and see a teacher talking with a microphone, which is connected to a IBM computer equipped with a voice recognition software and students are taking their lecture from the computer screen, don’t get thundered! Because now your job is to write the same program which can decode that mad teacher’s speech!
### 輸入限制
The input file will contain only one test case i.e. the encoded message.
The test case consists of one or more words.
### 輸出限制
For the given test case, print a line containing the decoded words. However, it is not so hard task to replace each letter or punctuation symbol by the two immediately to its left alphabet on your standard keyboard.
### 解題思路
1.先利用char陣列s存放鍵盤順序,記得不同行不能放一起。
2.使用tolower將所有字母變小寫。
3.利用指標前進兩格就可找到答案。
### 程式碼
```cpp=
#include<bits/stdc++.h>
using namespace std;
int main(){
char c,s[]="`1234567890-=" "qwertyuiop[]\\" "asdfghjkl;'" "zxcvbnm,./";
while(cin.get(c)){
c=tolower(c);
char *p=strchr(s,c);
if(p){
cout<<*(p-2);
}
else{
cout<<c;
}
}
}
```
## 測資
### Sample input
k[r dyt I[o
### Sample output
how are you
### Sample output
how are you
i love program
## 中文題目連結 [zerojudge e578](https://zerojudge.tw/ShowProblem?problemid=e578)