#P1348. [算法竞赛入门经典]WERTYU

[算法竞赛入门经典]WERTYU

Description

A common typing error is to place the hands on the keyboard one row to the right of the correct position. So ‘Q’ is typed as ‘W’ and ‘J’ is typed as ‘K’ and so on. You are to decode a message typed in this manner.

常见的输入错误是将手放在键盘上正确位置的右侧一行。因此,“ Q”键入为“ W”,而“ J”键入为“ K”,依此类推。您将解码以这种方式键入的消息。

Input Format

Input consists of several lines of text. Each line may contain digits, spaces, upper case letters (except Q, A, Z), or punctuation shown above [except back-quote (`)]. Keys labelled with words [Tab, BackSp, Control, etc.] are not represented in the input.

输入包含多行文本。每行可能包含数字,空格,大写字母(Q,A,Z除外)或上面显示的标点符号(反引号(`)除外)。标有单词[Tab,BackSp,Control等]的键未在输入中表示。

Output Format

You are to replace each letter or punction symbol by the one immediately to its left on the ‘QWERTY’ keyboard shown above. Spaces in the input should be echoed in the output.

您将在上面显示的“ QWERTY”键盘上,将每个字母或标点符号替换为紧靠左侧的字母或标点符号。输入中的空格应在输出中回显。

O S, GOMR YPFSU/​
I AM FINE TODAY.​

Source

数组与字符串