Created
September 4, 2019 12:46
-
-
Save Thiago4532/1302d89eb74bb74ded594ccc92217bd4 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 m, a, b; | |
cin >> m >> a >> b; | |
int c = m - (a + b); // Terceiro filho | |
if (a >= b && a >= c) cout << a << "\n"; // A é o maior | |
else if (b >= a && b >= c) cout << b << "\n"; // B é o maior | |
else if (c >= a && c >= b) cout << c << "\n"; // C é o maior | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment