WERTYU,不懂呀,要输入多行数据

来源:百度知道 编辑:UC知道 时间:2024/09/24 21:21:35
WERTYU

--------------------------------------------------------------------------------

Time Limit: 1 Second Memory Limit: 32768 KB

--------------------------------------------------------------------------------

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.

Input

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.

Output

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

你少了句f['2']='1';

我在你的基础上用STL map过了.代码如下:
#include<iostream>
#include<string>
#include <map>
using namespace std;
map<char,char>f;
int main(){
char ch[250];
int i,len;
f['=']='-'; f['-']='0'; f['0']='9'; f['9']='8'; f['8']='7';
f['7']='6'; f['6']='5'; f['5']='4'; f['4']='3'; f['3']='2'; f['2']='1';f['1']='`';

f['\\']=']'; f[']']='['; f['[']='P'; f['P']='O'; f['O']='I'; f['I']='U';
f['U']='Y'; f['Y']='T'; f['T']='R'; f['R']='E'; f['E']='W'; f['W']='Q';