#25936:


liu76214@gmail.com (Andrew liu)

學校 : 新竹市立建功高級中學
編號 : 92407
來源 : [111.243.122.123]
最後登入時間 :
2021-08-15 15:26:39
e578. 10222 - Decode the Mad man -- UVA | From: [111.243.107.3] | 發表日期 : 2021-07-05 22:04

#include <iostream>

#include <string>

 

 

using namespace std;

 

int main() {

string talk;

string keyboard = " `1234567890-=qwertyuiop[]\\asdfghjkl;'zxcvbnm,./";

while (getline(cin, talk)) {

for (int i = 0; i < talk.length(); i++) {

if (talk[i] >= 'A' && talk[i] <= 'Z') { //先大寫換成小寫

talk[i] += 32;

}

for (int j = 0; j < keyboard.length(); j++) {

 

if (talk[i] == keyboard[0]) {

cout << " ";

break;

}

else if (keyboard[j] == talk[i]) {

cout << keyboard[j - 2];

break;

}

}

}

cout << endl;

}

return 0;

}

 
ZeroJudge Forum