SHARE
TWEET

Untitled

a guest Sep 15th, 2019 68 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top