题解 | #整型数组合并#
整型数组合并
http://www.nowcoder.com/practice/c4f11ea2c886429faf91decfaf6a310b
public class Main{
public static void main(String[] agrs){
Scanner sc = new Scanner(System.in);
if(sc.hasNext()){
if (sc.hasNext()) {
TreeSet<Integer> treeSet = new TreeSet<>();
int one=sc.nextInt();
for (int i = 0; i <one ; i++) {
treeSet.add(sc.nextInt());
}
int two=sc.nextInt();
for (int i = 0; i <two ; i++) {
treeSet.add(sc.nextInt());
}
for (Integer integer : treeSet) {
System.out.print(integer);
}
}
}
}
}