题解 | #数字颠倒#
简单密码
http://www.nowcoder.com/practice/7960b5038a2142a18e27e4c733855dac
//最傻的方法
#include<iostream>
#include<string>
using namespace std;
int main(){
string input;
cin>>input;
for(int i = 0; i<input.length();i++){
if('a'<=input[i] && input[i]<='z'){
if('a'<=input[i] && input[i]<='c') input[i] = '2';
else if('d'<=input[i] && input[i]<='f') input[i] = '3';
else if('g'<=input[i] && input[i]<='i') input[i] = '4';
else if('j'<=input[i] && input[i]<='l') input[i] = '5';
else if('m'<=input[i] && input[i]<='o') input[i] = '6';
else if('p'<=input[i] && input[i]<='s') input[i] = '7';
else if('t'<=input[i] && input[i]<='v') input[i] = '8';
else if('w'<=input[i] && input[i]<='z') input[i] = '9';</string></iostream>
} else if('A'<=input[i] && input[i]<='Z'){ if(input[i]!='Z'){ input[i] +=33; } else input[i] = 'a'; } } cout<<input; return 0;
}