Skip to content

Instantly share code, notes, and snippets.

@Thiago4532
Created May 21, 2019 22:28
Show Gist options
  • Save Thiago4532/82717ce92f9acf635103fd7892bf0eae to your computer and use it in GitHub Desktop.
Save Thiago4532/82717ce92f9acf635103fd7892bf0eae to your computer and use it in GitHub Desktop.
#include <iostream> // Necessita da iostream para funcionar
using namespace std;
int main() {
vector< pair<int, int> > v = { {10, 1}, {1, 3}, {1, 2}, {2, 4}, {3, 5} }; // Declarando um vector de pair
// v = { (10, 1), (1, 3), (1, 2), (2, 4), (3, 5) }
sort(v.begin(), v.end());
// v = { (1, 2), (1, 3), (2, 4), (3, 5), (10, 1) }
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment