-
[C++] vector 객체의 최소값/최대값 찾기공부/C, C++ 2022. 7. 19. 23:03
#include <algorithm> #include <vector> vector <int> vec; int minNum = *min_element(vec.begin(), vec.end()); // 최소값 int maxNum = *max_element(vec.begin(), vec.end()); // 최대값
'공부 > C, C++' 카테고리의 다른 글
[BOJ] 10828 스택 / C++ (0) 2023.01.03 [C++] 부동소수점 숫자 자릿수 출력 (0) 2023.01.01 [C++] STL - map, set (0) 2022.05.12 [C/C++] long long 데이터 형의 shift 연산 수행 (0) 2022.05.03 [C++] 공백으로 문자열 자르기, for each문 (나중에 포스트 하기) (0) 2022.03.18