1.首先输入比较简单: import java.util.*; import java.io.*; public class Main{ public static void main(String[] args){ Scanner in1 = new Scanner(System.in); Scanner in2 =……