问一下,以下代码为什么运行不成功,谢谢了
import java.util.Scanner;
class Main
{
public static void main(String[] args)
{
// your code here
Map
// 明文 - 密文
encryption.put("A", "D");
encryption.put("B", "E");
encryption.put("C", "S");
encryption.put("D", "T");
encryption.put("E", "I");
encryption.put("F", "N");
encryption.put("G", "Y");
encryption.put("H", "A");
encryption.put("I", "B");
encryption.put("J", "C");
encryption.put("K", "F");
encryption.put("L", "G");
encryption.put("M", "H");
encryption.put("N", "J");
encryption.put("O", "K");
encryption.put("P", "L");
encryption.put("Q", "M");
encryption.put("R", "O");
encryption.put("S", "P");
encryption.put("T", "Q");
encryption.put("U", "R");
encryption.put("V", "U");
encryption.put("W", "V");
encryption.put("X", "W");
encryption.put("Y", "X");
encryption.put("Z", "Z");
Scanner scanner = new Scanner(System.in);
String next = scanner.nextLine();
String res = "";
for (int i = 0; i < next.length(); i++)
{
if (encryption.get(next.charAt(i) + "") != null)
{
res += encryption.get(next.charAt(i) + "");
}
else
{
res += next.charAt(i);
}
}
System.out.println(res);
}
}



