importjava.io.FileReader;importjava.io.FileWriter;importjava.io.IOException;importjava.util.Collections;importjava.util.Comparator;importjava.util.LinkedList;importjava.util.Scanner;publicclassStudent{doublechinese;doublemath;doubleenglish;doublesum;Stringsname;publicStudent(doublechinese,doublemath,doubleenglish,doublesum,Stringsname){this.chinese=chinese;this.math=math;this.english=english;this.sum=sum;this.sname=sname;}@OverridepublicStringtoString(){returnString.format("%s\t\t%2$.1f\t\t\t%3$.1f\t\t\t%4$.1f\t\t\t%5$.1f",sname,chinese,math,english,sum);}publicstaticvoidmain(String[]args){Scannerscanner=newScanner(System.in);LinkedListlist=newLinkedList();System.out.println("从键盘输入学生的信息,输入格式为:name,30,30,30(姓名,三门课成绩)");while(scanner.hasNextLine()){Stringline=scanner.nextLine().trim();if("".equals(line)){break;}String[]info=line.split("\\,");Stringname=info[0];doublechinese=0;doublemath=0;doubleenglish=0;doublesum=0;try{chinese=Double.parseDouble(info[1]);math=Double.parseDouble(info[2]);english=Double.parseDouble(info[3]);sum=chinese+math+english;}catch(Exceptione){System.out.println("格式不正确,重写输入:");continue;}Studentstudent=newStudent(chinese,math,english,sum,name);list.add(student);}scanner.close();Collections.sort(list,newComparator(){@Overridepublicintcompare(Studento1,Studento2){if(o1.sum>o2.sum){return-1;}elseif(o1.sum |