Advertisement
a53

bisectoare1

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