#include <algorithm>
struct A
{
int x, y;
};
int main()
{
A array[1000];
//...
std::sort(array, array+1000, [](A a, A b){ return a.x < b.x; });
std::sort(array, array+1000, [](A a, A b){ return a.y < b.y; });
}
I2luY2x1ZGUgPGFsZ29yaXRobT4KCnN0cnVjdCBBCnsKICAgIGludCB4LCB5Owp9OwoKaW50IG1haW4oKQp7CiAgICBBIGFycmF5WzEwMDBdOwogICAgLy8uLi4KICAgIHN0ZDo6c29ydChhcnJheSwgYXJyYXkrMTAwMCwgW10oQSBhLCBBIGIpeyByZXR1cm4gYS54IDwgYi54OyB9KTsKICAgIHN0ZDo6c29ydChhcnJheSwgYXJyYXkrMTAwMCwgW10oQSBhLCBBIGIpeyByZXR1cm4gYS55IDwgYi55OyB9KTsKfQ==