1 public static void main(String[] args){ 2 Scanner scanner = new Scanner(System.in); 3 System.out.println("please enter something:"); 4 String str = scanner.nextLine(); 5 char[] array = str.toCharArray(); //获取字符数组 6 for (int i = 0; i<array.length;i++){ 7 array[i] = (char)(array[i]^2000); 8 } 9 System.out.println("加密结果:"+ new String(array)); 10 }
时间: 2024-11-08 23:43:31