题解 | #有序序列合并#
有序序列合并
http://www.nowcoder.com/practice/a9e943b0dab142759807d0cfb6863897
import java.util.Scanner; import java.util.Arrays; public class Main { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int n=sc.nextInt(); int m=sc.nextInt(); int[] array=new int[n]; int[] brray=new int[m]; int[] crray=new int[n+m]; int x=0; while(sc.hasNext()) { crray[x++]=sc.nextInt(); } Arrays.sort(crray); for(int i=0;i<x;i++) { System.out.print(crray[i]+" "); } } }