题解 | #明明的随机数#
https://www.nowcoder.com/practice/3245215fffb84b7b81285493eae92ff0
import java.util.*;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
HashSet<Integer> hs = new HashSet<>();
for(int i=0;i<n;i++){
hs.add(sc.nextInt());
}
ArrayList<Integer> li = new ArrayList<>();
for(int i:hs){
li.add(i);
}
Collections.sort(li);
for(int i:li){
System.out.println(i);
}
}
}
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
HashSet<Integer> hs = new HashSet<>();
for(int i=0;i<n;i++){
hs.add(sc.nextInt());
}
ArrayList<Integer> li = new ArrayList<>();
for(int i:hs){
li.add(i);
}
Collections.sort(li);
for(int i:li){
System.out.println(i);
}
}
}