4行代码直接AC String n=sc.nextLine(); String i=sc.nextLine(); String j=sc.nextLine(); System.out.print(Integer.valueOf(i, 2)^Integer.valueOf(j, 2));