public class Main { //把输入得数字转化为数组 数组转set去重 通过Collections.sort 排序 public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); Set<Integer> set1 = new HashSet<>(); Integer arr[] = new Integer[n]; for (int i = 0; i < n; i++) { ...