题解 | #明明的随机数#

明明的随机数

https://www.nowcoder.com/practice/3245215fffb84b7b81285493eae92ff0

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

int main() {
    int n;
    cin>>n;
    int num;
    set<int> set;
    while(n--)
    {
        cin>>num;
        set.insert(num);
    } 
    for(auto pos=set.begin();pos!=set.end();pos++)
    {
        cout<<*pos<<endl;
    }
    return 0;
}

全部评论

相关推荐

06-05 19:46
已编辑
武汉大学 后端
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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