#include<iostream>
#include<cstdio>
#include<cmath>
#include<cstring>
using namespace std;
int main()
{
double m1, m2, m3;
double a, b, c, s, area;
while(scanf("%lf%lf%lf", &m1, &m2, &m3)==3)
{
a=sqrt((2*m2*m2)+(2*m3*m3)-(m1*m1))*0.666666666;
b=sqrt((2*m1*m1)+(2*m3*m3)-(m2*m2))*0.666666666;
c=sqrt((2*m1*m1)+(2*m2*m2)-(m3*m3))*0.666666666;
s=(a+b+c)/2;
area = sqrt(s*(s-a)*(s-b)*(s-c));
if(area>0)
{
printf("%0.3lf\n", area);
}
else
{
area=-1;
printf("%0.3lf\n", area);
}
}
}
#include<cstdio>
#include<cmath>
#include<cstring>
using namespace std;
int main()
{
double m1, m2, m3;
double a, b, c, s, area;
while(scanf("%lf%lf%lf", &m1, &m2, &m3)==3)
{
a=sqrt((2*m2*m2)+(2*m3*m3)-(m1*m1))*0.666666666;
b=sqrt((2*m1*m1)+(2*m3*m3)-(m2*m2))*0.666666666;
c=sqrt((2*m1*m1)+(2*m2*m2)-(m3*m3))*0.666666666;
s=(a+b+c)/2;
area = sqrt(s*(s-a)*(s-b)*(s-c));
if(area>0)
{
printf("%0.3lf\n", area);
}
else
{
area=-1;
printf("%0.3lf\n", area);
}
}
}
No comments:
Post a Comment