Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- float a, b, c, ba, bb, bc, p;
- bool Valid(float x, float y, float z)
- {
- if(x + y <= z || x + z <= y || y + z <= x)
- return false;
- else
- return true;
- }
- int main()
- {
- cin>>a>>b>>c;
- if(!Valid(a,b,c))
- cout<<"Imposibil";
- else
- {
- p=(a+b+c)/2.0;
- ba=2.0/(b+c)*sqrt(p*b*c*(p-a));
- bb=2.0/(a+c)*sqrt(p*a*c*(p-b));
- bc=2.0/(b+a)*sqrt(p*b*a*(p-c));
- cout<<setprecision(2)<<fixed<<(int)(ba*100)/100.0<<' ';
- cout<<setprecision(2)<<fixed<<(int)(bb*100)/100.0<<' ';
- cout<<setprecision(2)<<fixed<<(int)(bc*100)/100.0;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement