public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.println("请输入姓名,语文成绩,数学成绩,英语成绩");
TreeSet<String> ts = new TreeSet<>(new Comparator<String>() {
@Override
public int compare(String s1, String s2) {
int num = s1.compareTo(s2);
return num==0 ? 1:num;
}
});
while (ts.size()<5) {
String line = sc.nextLine();
String[]arr = line.split(",");
int chinese = Integer.parseInt(arr[1]);
int math = Integer.parseInt(arr[2]);
int english = Integer.parseInt(arr[3]);
}
}
}
|
|