题解 | #简单密码# 懒人方法
简单密码
https://www.nowcoder.com/practice/7960b5038a2142a18e27e4c733855dac
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc =new Scanner(System.in);
String from="abcdefghijklmnopqrstuvwxyz";
String to= "22233344455566677778889999";
String result=new String();
if(sc.hasNextLine()){
String s=sc.nextLine();
int len=s.length();
for(int i=0;i<len;i++){
char temp=s.charAt(i);
int index=from.indexOf(temp);
if(index!=-1){
result+=to.charAt(index);
}else{
if(temp>='A'&&temp<'Z'){
temp+=32+1;
result+=temp;
}else if(temp=='Z'){
result+='a';
}else{
result+=temp;
}
}
}
}
System.out.println(result);
}
}


