标签:ios div iostream mes i++ ret return sort bsp
基本思想:
无;
关键点:
无;
#include<iostream> #include<string> #include<algorithm> #include<vector> using namespace std; struct node { int x; int y; }; node num[1010]; bool cmp(node a, node b) { if (a.x == b.x) return a.y < b.y; else { return a.x < b.x; } } int main() { int n; while (cin >> n) { for (int i = 0; i < n; i++) { cin >> num[i].x >> num[i].y; } sort(num, num + n, cmp); cout << num[0].x << " " << num[0].y << endl; } }
标签:ios div iostream mes i++ ret return sort bsp
原文地址:https://www.cnblogs.com/songlinxuan/p/12458040.html