View Code of Problem 24

#include <stdio.h>
#include <iostream>
#include <string.h>
#include <string>
#include <algorithm>
#include <iomanip>
#include<vector>
#include<math.h>
using namespace std;
int main()
{
	int a, b, c;
	while (cin >> a >> b >> c) {
			double p = (a + b + c) / 2.0;
			double s =sqrt( (p*(p - a)*(p - b)*(p - c)));
			cout << fixed << setprecision(2) << s<<endl;
	}
}

Double click to view unformatted code.


Back to problem 24