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 |
Tags
- 컴퓨터 그래픽스
- queue
- 시스템프로그래밍
- Array
- Deque
- 아두이노 컴파일러
- Arduino
- 자료구조
- 운영체제
- LineTracer
- 통계학
- stl
- priority_queue
- vector
- Visual Micro
- map
- c++
- C언어
- html
- set
- list
- Algorithm
- 아두이노 소스
- 수광 소자
- Stack
- WinAPI
- 라인트레이서
- 아두이노
- directx
- arduino compiler
Archives
- Today
- Total
Kim's Programming
Algorithm - max() 본문
원형)
1 2 3 4 5 6 | //기본형 template <class T> const T& max (const T& a, const T& b); //사용자 정의형 template <class T, class Compare> const T& max (const T& a, const T& b, Compare comp); | cs |
의미)
a와 b 중에서 큰 값을 리턴한다.
소스)
1 2 3 4 5 6 7 8 9 | #include <iostream> #include <algorithm> void main() { std::cout << "max -> " << std::max(5, 7) << std::endl; std::cout << "max -> " << std::max(4, 1) << std::endl; } | cs |
리턴값)
max(x,y)함수는 x,y중에서 큰 값을 리턴합니다.
결과)
'STL - Algorithm > Algorithm - Min&Max' 카테고리의 다른 글
Algorithm - minmax_element() (0) | 2017.06.22 |
---|---|
Algorithm - max_element() (0) | 2017.06.22 |
Algorithm - min_element() (0) | 2017.06.22 |
Algorithm - minmax() (0) | 2017.06.22 |
Algorithm - min() (0) | 2017.06.22 |