题解 | #明明的随机数#

明明的随机数

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

//https://www.nowcoder.com/practice/3245215fffb84b7b81285493eae92ff0?tpId=37&rp=1&ru=%2Fexam%2Foj%2Fta&qru=%2Fexam%2Foj%2Fta&sourceUrl=%2Fexam%2Foj%2Fta%3FtpId%3D37&difficulty=&judgeStatus=&tags=&title=&gioEnter=menu

#include <iostream>
#include <set>

using namespace std;

int main() {
    int n = 0;

    while (cin >> n) {
        set<int> num;
        int tem = 0;

        for(int i = 0;i<n;i++){
            cin >> tem;

            num.insert(tem);
        }

        for(auto c:num)
            cout << c << endl;
    }
}

全部评论

相关推荐

牛客963010790号:为什么还要收藏
点赞 评论 收藏
分享
评论
点赞
收藏
分享
牛客网
牛客企业服务