Advertisement
Guest User

Untitled

a guest
Sep 15th, 2019
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5.  
  6. int main() {
  7. int m, a, b;
  8. cin >> m >> a >> b;
  9. int c = m - (a + b); // Terceiro filho
  10.  
  11. if (a >= b && a >= c) cout << a << "\n"; // A é o maior
  12. else if (b >= a && b >= c) cout << b << "\n"; // B é o maior
  13. else if (c >= a && c >= b) cout << c << "\n"; // C é o maior
  14. return 0;
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement