很简单的题,把数带进公式即可
代码:
#include <cstdio>
#include <cmath>
double a, b, c, d, e, f;
int main()
{
while ( scanf("%lf%lf%lf%lf%lf%lf", &a, &b, &c, &d, &e, &f) != EOF ) {
double tr1, tr2, tr3, tr4, temp, ans;
tr1 = acos( (c*c+b*b-f*f)/(2.0*b*c) );
tr2 = acos( (a*a+c*c-e*e)/(2.0*a*c) );
tr3 = acos( (a*a+b*b-d*d)/(2.0*a*b) );
tr4 = ( tr1 + tr2 +tr3 )/2.0;
temp = sqrt( sin(tr4) * sin(tr4-tr1) * sin(tr4-tr2) * sin(tr4-tr3) );
ans = a*b*c*temp/3.0;
printf("%.4lf\n", ans);
}
}