C++ 11 代码如下:
#include<iostream>
using namespace std;
const char s[] = { "`1234567890-=QWERTYUIOP[]\\ASDFGHJKL;'ZXCVBNM,./" }; //注意转义字符
int main() {
int c, i;
while ((c = getchar()) != EOF) {
for (i = ; s[i] && s[i] != c; i++);
if (s[i]) putchar(s[i - ]);
else putchar(c);
}
return ;
}