View Code of Problem 24

#include<string>
#include<cstring>
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<iomanip>
#include<vector>
#include<cstring>
using namespace std;
int main()
{
	long long a, b, c;
	while (cin >> a >> b >> c)
	{
		double cos = (a*a + b * b - c * c) / (double)(2 * a*b);
		double sin = sqrt(1 - cos * cos);
		double s = 0.5*a*b*sin;
		cout << fixed << setprecision(2) << s << endl;
	}
}

Double click to view unformatted code.


Back to problem 24