Advertisement
Guest User

Untitled

a guest
Feb 11th, 2016
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.35 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     int a,b,c;
  8.     cin >> a >> b >> c;
  9.     int ab = a + b;
  10.     int ac = a + c;
  11.     int bc = b + c;
  12.  
  13.     if (ab > ac && ab > bc){
  14.         cout << ab << endl;
  15.     }
  16.     else if (ac > ab && ac > bc){
  17.         cout << ac << endl;
  18.     }
  19.     else {
  20.         cout << bc << endl;
  21.     }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement