题解 | #有序序列合并#

有序序列合并

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]+" ");
        }
    }
}

全部评论

相关推荐

09-29 00:03
门头沟学院 Java
点赞 评论 收藏
分享
不愿透露姓名的神秘牛友
08-20 19:41
那一天的Java_J...:简历完全流水账,学生思维很严重,还有很大的优化空间,可以多看看牛客的简历。
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务