#include #include #include #include #include #include #include #include #include typedef struct human { int height; int weight; char name; }HUMAN; bool f(HUMAN a, HUMAN b) { if (a.height > b.height) return true; else if (a.height == b.height) { if (a.weight < b.weight) return true; } return false; } int main() { HUMAN human[3]; std::string name = "ABC"; for (size_t i = 0; i < 3; i++) { std::cin >> human[i].height >> human[i].weight; human[i].name = name[i]; } std::sort(human, human + 3, f); for (size_t i = 0; i < 3; i++) { std::cout << human[i].name << std::endl; } return 0; }