View Code of Problem 24

#include <stdio.h>
#include <math.h>
int main()
{
	int a, b, c;
	float s, x, y, k;
	while (scanf("%d%d%d", &a, &b, &c) != EOF)
	{
		x = a*a + b*b - c*c;
		y = 2 * a*b;
		k = sqrt(1 - pow((x / y), 2));
		s = a*b*k / 2;
		printf("%.2f\n", s);
	}
	return 0;
}

Double click to view unformatted code.


Back to problem 24