题解 | #整型数组合并#

整型数组合并

https://www.nowcoder.com/practice/c4f11ea2c886429faf91decfaf6a310b

#include <iostream>
#include <set>
#include <algorithm>
using namespace std;

int main() {
    int num1;
    cin >> num1;
    int a;
    set<int> data;
    for (int i = 0; i < num1;i++)
    {
        cin >> a;
        data.insert(a);
    }

    int num2;
    cin >> num2;
    int b;
    for (int i = 0; i < num2;i++)
    {
        cin >> b;
        data.insert(b);
    }

    for (auto it : data)
    {
        cout << it ;
    }

}
// 64 位输出请用 printf("%lld")

全部评论

相关推荐

程序员小白条:你是沟通了900个,不是投了900份简历,你能投900份,意味着对面都要回复你900次,你早就找到实习了,没亮点就是这样的,别局限地区,时间投的也要早,现在都要7月了
点赞 评论 收藏
分享
06-07 19:59
门头沟学院 C++
补药卡我啊😭:都快15年前的了还在11新特性
你的简历改到第几版了
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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