U E D R , A S I H C RSS

The Knights Of The Round Table/문보창

소감

2006-02-09 Accepted 0.031 Minimum

코드

~cpp
// 10195 - The Knights of the Round Table
#include <iostream>
using namespace std;
#include <cstdio>
#include <cmath>

void process(const double a, const double b, const double c)
{
	double area, s, r;
	s = (a + b + c) / 2;
	area = sqrt(s * (s - a) * (s - b) * (s - c));
	r = ((a + b + c) != 0) ? (2 * area) / (a + b + c) : 0;
	printf("The radius of the round table is: %.3f\n", r);
}

int main()
{
	double a, b, c;
	while (cin >> a >> b >> c)
		process(a, b, c);
	return 0;
}
Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2021-02-07 05:28:12
Processing time 0.0222 sec