rengetsu

KVALIF_VGTU_C

Mar 17th, 2020
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.50 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstdio>
  3. #include <math.h>
  4. #include <algorithm>
  5. using namespace std;
  6. int main()
  7. {
  8.     int x[3];
  9.     cin >> x[0] >> x[1] >> x[2];
  10.     sort(x, x+3);
  11.     if( ( x[0] * x[1] ) == ((x[2]) *2) ){cout <<  sqrt( ( x[0] * x[0] ) + ( x[1] * x[1] ) );}
  12.     else if( ( (x[0] * x[0] ) + ( x[1] * x[1] ) ) == sqrt ( x[2] * x[2] ) ){ cout << (x[0] * x[1]) / 2;}
  13.     else if( (sqrt( ( x[2] * x[2] ) - ( x[0] * x[0] ) ) ) == x[1] ){ cout << (x[0] * x[1])/2;}
  14.     else{ cout << ( (x[2]*2)/x[0] );}
  15.     return 0;
  16. }
Add Comment
Please, Sign In to add comment