题解 | #整型数组合并#

整型数组合并

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);
                }
            }
        }
    }
}
全部评论

相关推荐

06-07 21:26
江南大学 C++
话不多说,直接上时间线和图片1.2024年10月底发offer,并签三方2.2025年5月底公司违约
从零开始的转码生活:希望所有签了三方但直接违约的公司都倒闭!都倒闭!都倒闭!
点赞 评论 收藏
分享
白火同学:大二有这水平很牛了,可以适当对关键信息加粗一点,比如关键技术、性能指标之类的。
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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