소감

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;
}
Retrieved from http://wiki.zeropage.org/wiki.php/TheKnightsOfTheRoundTable/문보창
last modified 2021-02-07 05:28:12