Advertisement
a53

RazaCercCircumscris

a53
Jun 29th, 2021
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. float a, b, c, s, A, radius;
  4.  
  5. bool Valid(float x, float y, float z)
  6. {
  7. if(x + y <= z || x + z <= y || y + z <= x)
  8. return false;
  9. else
  10. return true;
  11. }
  12.  
  13. int main()
  14. {
  15. cin>>a>>b>>c;
  16. if(!Valid(a,b,c))
  17. cout<<"Imposibil";
  18. else
  19. {
  20. s=(a+b+c)/2;
  21. A = sqrt((s*(s-a)*(s-b)*(s-c)));
  22. radius=a*b*c/(4*A);
  23. cout<<setprecision(2)<<fixed<< (int)(radius*100)/100.0;
  24. }
  25. return 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement