public class Test1 {
public static void main(String[] args) {
Set<Student2> set = new TreeSet<>(new Comparator<Student2>() {
public int compare(Student2 s1,Student2 s2){
int num = s1.getSum() - s2.getSum();
return num == 0 ? 1 : num ;
}
});
Scanner sc = new Scanner(System.in);
System.out.println("请输入学生考试成绩:");
while(true) {
String line = sc.nextLine();
if("quit".equals(line))
break;
String[] arr = line.split(",");
set.add(new Student2(arr[0],Integer.parseInt(arr[1]),Integer.parseInt(arr[2]),
Integer.parseInt(arr[3])));
}
System.out.println("输出学生信息");
for (Student2 student2 : set) {