[개념정리] STL라이브러리 - sort()1
풀이 일시 : 2020-07-31 개념 : C++의 algorithm 헤더에 포함되어있는 함수로 정렬을 수행할 수 있다. 활용1 : 기본 사용 - 주어진 숫자를 sort()로 쉽게 오름차순 정렬한다. #include #include using namespace std; int main(void) { int a[10] = { 9,3,5,4,1,10,8,6,7,2 }; sort(a, a + 10); for (int i = 0; i < 10; i++) { cout score < student.score; //기준 (내점수가 더 낮다면 우선순위가높다) } }; //클래스 생성완료 int main() { Student students[] = { Student("A",35), Student("B",24), ..
2020. 12. 26.