Created
May 21, 2019 22:23
-
-
Save Thiago4532/f123e9030aa9dd848df0eff82fd89052 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> // Necessita da iostream para funcionar | |
using namespace std; | |
int main() { | |
pair<int, string> A = {10, "Thiago"}; | |
pair<int, string> B = {20, "Lawrence"}; | |
pair<int, string> C = {20, "Davi"}; | |
if(A < B) { | |
// A é menor do que B pois 10 é menor do que 20. (Primeiro ele compara o primeiro valor). | |
} | |
if(C < B){ | |
// C é menor do que B nesse caso, pois como o primeiro valor é igual, ele compara pelo segundo. Como 'D' vem antes de 'L', C < B | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment