解题思路:
注意事项:
参考代码:
import java.util.Scanner;
import java.util.TreeMap;
public class C1052{
public static void main(String[] args){
Scanner input=new Scanner(System.in);
int sum=input.nextInt()+input.nextInt();
TreeMap<Integer,Integer> treemap=new TreeMap<>();
for(int i=0;i<sum;i++){
treemap.put(input.nextInt(),input.nextInt());
}
for(Integer i:treemap.keySet()){
System.out.println(i+" "+treemap.get(i));
}
}
}
0.0分
5 人评分