华为题库 HJ3 明明的随机数

HJ3 明明的随机数

在这里插入图片描述

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

int main() {
    
    
    int N = 0;
    set<int> myset;
    cin >> N;
    int tmp;
    while(N--)
    {
    
    
        cin >> tmp;
        myset.insert(tmp);
    }

    for(auto it:myset) 
        cout<<it<<endl;
}
// 64 位输出请用 printf("%lld")

猜你喜欢

转载自blog.csdn.net/qq_44814825/article/details/130027506