U E D R , A S I H C RSS

The Knights Of The Round Table/김상섭

~cpp
#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;
}
Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2021-02-07 05:28:13
Processing time 0.0091 sec