Created
September 9, 2021 00:47
-
-
Save Thiago4532/5f57fbd3a54a7fc5297af77fd61192a9 to your computer and use it in GitHub Desktop.
This file contains 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 <bits/stdc++.h> | |
using namespace std; | |
int main() { | |
int a, b; | |
cin >> a >> b; | |
if (a > b) | |
swap(a, b); // 'a' vira o menor elemento | |
// Vamos fazer o elemento 'a' ser a mediana. | |
int c = a - (b - a); // c < a < b | |
cout << c << '\n'; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment