题解 | #明明的随机数#

明明的随机数

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;
}

全部评论

相关推荐

站队站对牛:兄弟 你这是四年就当大一过了吧 也许你校园卡 赚了有五位数了
点赞 评论 收藏
分享
鲁大牛:第一次美团笔试因为用豆包没做出来。第二次笔试之前重金充了一个gpt5pro的会员。结果第二次不考ai算法题了
投递美团等公司10个岗位
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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