题解 | #Simple Sorting#

Simple Sorting

https://www.nowcoder.com/practice/139761e0b59a405786898b7f2db9423f

#include<iostream>
using namespace std;
#include<set>
int main()
{
    int n;
    
    set<int> s;
    
    cin>>n;
    int * h;
    h = new int [n];
    for(int i=0;i<n;i++)
    {
        cin>>h[i];
        s.insert(h[i]);
    }
    for(auto it=s.begin();it!=s.end();it++)
    {
        cout<<*it<<" ";
    }
}

全部评论

相关推荐

不愿透露姓名的神秘牛友
07-07 13:47
机械打工仔:你自己匿名可以,这么好的公司就别给它匿名了
点赞 评论 收藏
分享
不愿透露姓名的神秘牛友
07-09 12:02
ssob上原来真有BOSS啊
硫蛋蛋:这种也是打工的,只不是是给写字楼房东打工
点赞 评论 收藏
分享
码农索隆:7*24,随时待命,这是去🇷🇺打仗去了啊
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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