ь
1 2 3 4 5 6 7 8 9 10 11 12
|
#include <iostream>
#include <vector>
#include <utility>
#include <algorithm>
using namespace std;
int main()
{
vector<pair<double,double>> pts = { { 1.5, 2 }, { 0.5, 6.3 }, { 1.5, 1.5 }, { -0.3, 1.5 } };
sort( pts.begin(), pts.end() );
for ( auto p : pts ) cout << p.first << ", " << p.second << '\n';
}
| |
Topic archived. No new replies allowed.