package com.test;
import com.bean.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import com.bean.Student;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Random;
import java.util.Scanner;
import java.util.TreeSet;
import com.bean.Student;
public class test {
//@SuppressWarnings({ "rawtypes", "unchecked" })
public static void main(String[] args) {
//extracted();
//extracted_2();
//extracted_3();
//extracted_4(c);
//extracted_7();
//键盘录入
Scanner sc =new Scanner(System.in);
System.out.println("please String:");
//String line =sc.nextLine();
//定义集合,传入比较器对数组排序并保留重复,TreeSet
TreeSet<Integer> ts =new TreeSet<>(new Comparator<Integer>() {
@Override
public int compare(Integer o1, Integer o2) {
// TODO Auto-generated method stub
int num= o2-o1;
return num==0? 1 :num;
}
});
//无限循环不断收入整数,遇到quit退出,
while(true) {
String line =sc.nextLine();
if("quit".equals(line)) {
break;
}
Integer i =Integer.parseInt(line);
ts.add(i);
}
//遍历打印
for(Integer integer:ts) {
System.out.println(integer);
}
}