백준 c++1165번 좌표 정렬하기 2(sort 함수 응용)


백준 c++1165번 좌표 정렬하기 2(sort 함수 응용)

#include #include using namespace std; typedef struct point { int x; int y; } mpoint; //bool xcompare(mpoint a, mpoint b) //{ // return(a.x < b.x); //} bool ycompare(mpoint a, mpoint b) { if (a.y < b.y) return true; else if (a.y == b.y) { if (a.x < b.x) return (true); } return false; } int main() { int point_num; cin >> point_num; mpoint * position = new mpoint [point_num]; for (int i = 0; i < p..


원문링크 : 백준 c++1165번 좌표 정렬하기 2(sort 함수 응용)