U E D R , A S I H C RSS

The Knights Of The Round Table/김상섭

No older revisions available

No older revisions available



~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 2009-05-27 07:09:19
Processing time 0.0120 sec