VioletaBabel

10867번: 중복 빼고 정렬하기 본문

백준/백준-C++
10867번: 중복 빼고 정렬하기
Beabletoet 2017. 6. 5. 22:40

#include<cstdio>

#include<set>

using namespace std;

int main()

{

set<int> num;

int n, a;

scanf("%d", &n);

for (int i = 0; i < n; ++i)

{

scanf("%d", &a);

num.insert(a);

}

for (set<int>::iterator iter = num.begin(); iter != num.end(); ++iter)

printf("%d ", *iter);

}

'백준 > 백준-C++' 카테고리의 다른 글

10816번: 숫자 카드 2 (실패)  (0) 2017.06.05
10815번: 숫자 카드  (0) 2017.06.05
2346번: 풍선 터뜨리기 (실패)  (0) 2017.06.05
2618번: 경찰차 (실패)  (0) 2017.06.05
11816번: 8진수, 10진수, 16진수  (0) 2017.06.04
Comments