Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include "Animal.cpp"
- #include <algorithm>
- #include <vector>
- using namespace std;
- bool cmp(pair<int, int> x, pair<int, int> y) {
- return x.second > y.second;
- }
- int main() {
- vector<pair<int, int>> a = {{1, 3}, {2, 8}, {1, 4}, {-2, 5}, {8, -6}};
- sort(a.begin(), a.end(), cmp);
- for (auto e : a) {
- cout << e.first << ' ' << e.second << '\n';
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement