Advertisement
Md_Touhid

URI - Problem 1013 - The Greatest

Apr 14th, 2020
330
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.37 KB | None | 0 0
  1. #include<iostream>
  2. #include<iomanip> //for setprecision()
  3. #include<cstdio> //for scanf()
  4. #include<cmath> //for abs()
  5.  
  6. using namespace std;
  7.  
  8. int main()
  9. {
  10.     int a, b, c;
  11.  
  12.     scanf("%d %d %d", &a, &b, &c);
  13.  
  14.     int maior_1 = (a+b+abs(a-b)) / 2;
  15.     int maior_2 = (maior_1+c+abs(maior_1-c)) / 2;
  16.  
  17.     cout << maior_2 << " eh o maior" << endl;
  18.  
  19.     return 0;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement