publicclassMain{ publicstaticvoidmain(String[] args){ Scanner sc = new Scanner(System.in); int n = sc.nextInt(); sc.nextLine(); List<Stu> list = new ArrayList<>(); for(int i =0;i<n;i++){ String[] input = sc.nextLine().split(" "); Stu stu = new Stu(input[0],input[1],Integer.parseInt(input[2])); list.add(stu); } //排序 Collections.sort(list); //输出最好的 System.out.println(list.get(n-1).tostring()); //输出最差的 System.out.println(list.get(0).tostring()); } } classStuimplementsComparable<Stu>{ String name; String Sno; int score;