2025/04 28

c++ 문제 풀이 - 객체의 정렬 2

이번에는 선생님께서 주신 문제를 풀어보고, 복습하는 개념으로 블로그를 작성했습니다. #include#include#include#includeusing namespace std;class Person { public:int height; public:int weight; public:int num;};bool Comp(Person a, Person b) { if (a.height == b.height) return a.weight > b.weight; return a.height > n; vector arr(n); for (int i = 0; i > arr[i].height >> arr[i].weight; arr[i].num = i + 1; } sort(arr.begin(), arr.end(), Co..