输出合并之后的数组
import java.util.Scanner;
import java.util.TreeSet;
public class Main
{
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
while (scanner.hasNext())
{
TreeSet set = new TreeSet<>();
int n1 = scanner.nextInt();
for (int i = 0; i < n1; i++)
set.add(scanner.nextInt());
int n2 = scanner.nextInt();
for (int i = 0; i < n2; i++)
set.add(scanner.nextInt());
for (int n: set)
System.out.print(n);
System.out.println();
}
}
}