Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstdio>
- #include <math.h>
- #include <algorithm>
- using namespace std;
- int main()
- {
- int x[3];
- cin >> x[0] >> x[1] >> x[2];
- sort(x, x+3);
- if( ( x[0] * x[1] ) == ((x[2]) *2) ){cout << sqrt( ( x[0] * x[0] ) + ( x[1] * x[1] ) );}
- else if( ( (x[0] * x[0] ) + ( x[1] * x[1] ) ) == sqrt ( x[2] * x[2] ) ){ cout << (x[0] * x[1]) / 2;}
- else if( (sqrt( ( x[2] * x[2] ) - ( x[0] * x[0] ) ) ) == x[1] ){ cout << (x[0] * x[1])/2;}
- else{ cout << ( (x[2]*2)/x[0] );}
- return 0;
- }
Add Comment
Please, Sign In to add comment