Notice
Recent Posts
Recent Comments
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | 5 | 6 | |
| 7 | 8 | 9 | 10 | 11 | 12 | 13 |
| 14 | 15 | 16 | 17 | 18 | 19 | 20 |
| 21 | 22 | 23 | 24 | 25 | 26 | 27 |
| 28 | 29 | 30 | 31 |
Tags
- 아두이노 소스
- C언어
- vector
- Array
- c++
- queue
- priority_queue
- WinAPI
- 통계학
- Algorithm
- 라인트레이서
- 컴퓨터 그래픽스
- map
- set
- html
- 아두이노
- list
- stl
- 자료구조
- 아두이노 컴파일러
- 수광 소자
- Visual Micro
- 운영체제
- directx
- Deque
- 시스템프로그래밍
- Stack
- arduino compiler
- LineTracer
- Arduino
Archives
- Today
- Total
Kim's Programming
Set - upper_bound() 본문
소스)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | #include<set> #include<iostream> void print(std::set<int> Target_Set) { for (std::set<int>::iterator IterPos = Target_Set.begin(); IterPos != Target_Set.end(); ++IterPos) std::cout << *IterPos << " "; std::cout << std::endl; } void main() { std::set<int> Set = { 1,3,5,7,9,11 }; print(Set); std::cout << *Set.upper_bound(3) << std::endl; print(Set); } | cs |
내용)
upper_bound(x)함수는 정렬순서에서 x보다 크면서 가장 작은 값을 가리키는 iterator를 리턴합니다. (같은 순위 제외)
결과)
'STL - Container > Container - Set' 카테고리의 다른 글
| Set - Operator '=' (0) | 2016.02.01 |
|---|---|
| Set - value_comp (0) | 2016.02.01 |
| Set - swap() (0) | 2016.02.01 |
| Set - max_size() (0) | 2016.02.01 |
| Set - lower_bound() (2) | 2016.02.01 |