题解 | #明明的随机数#

明明的随机数

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

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

const int N = 1010;

int main() {
    int n, a;
    set<int> s;
    cin >> n;
    while (n--) {
        cin >> a;
        s.insert(a);
    }

    for (auto it = s.begin(); it != s.end(); it++)
        cout << *it << endl;

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

全部评论

相关推荐

点赞 收藏 评论
分享
牛客网
牛客企业服务