a53

Mediane

a53
Jun 29th, 2021
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3. using namespace std;
  4. int main()
  5. {
  6. double a,b,c,ma,mb,mc;
  7. int Ma,Mb,Mc;
  8. cin>>a>>b>>c;
  9. if(a+b>c && b+c>a && a+c>b)
  10. {
  11. ma=sqrt(2*(b*b+c*c)-a*a)/2;
  12. mb=sqrt(2*(a*a+c*c)-b*b)/2;
  13. mc=sqrt(2*(a*a+b*b)-c*c)/2;
  14. Ma=ma*100;
  15. Mb=mb*100;
  16. Mc=mc*100;
  17. cout<<Ma/100<<"."<<Ma/10%10<<Ma%10<<" ";
  18. cout<<Mb/100<<"."<<Mb/10%10<<Mb%10<<" ";
  19. cout<<Mc/100<<"."<<Mc/10%10<<Mc%10<<" ";
  20. }
  21. else
  22. cout<<"Imposibil";
  23. return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment