Toggle menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

TheKnightsOfTheRoundTable/김상섭

From ZeroWiki
Revision as of 05:28, 7 February 2021 by imported>Unknown
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
#include <iostream>
#include <math.h>
using namespace std;

void process(double a, double b, double c)
{
	double s = (a+b+c)/2.0;
	if(a == 0.0 && b ==0.0 && c==0.0)
		cout << "The radius of the round table is: 0.000" << endl;
	else
	{
		double temp = 2.0*sqrt(s*(s-a)*(s-b)*(s-c))/(a+b+c);
		cout <<  "The radius of the round table is: " << temp << endl;
	}
}

int main()
{
    cout.setf(ios::fixed, ios::floatfield);   
    cout.setf(ios::showpoint);   
    cout.precision(3); 

	double a,b,c;

	while(cin >> a >> b >> c)
	{
		process(a,b,c);
	}

	return 0;
}