Saturday, April 9, 2011

10195 - The Knights Of The Round Table


#include<iostream>
#include<cstdlib>
#include<cstdio>
#include<cmath>
using namespace std;
int main()
{
    long double a,b,c,s,r;
    freopen("in.txt","r",stdin);
    while(scanf("%Lf%Lf%Lf",&a,&b,&c)==3)
    {
        if(!a||!b||!c)
        {
            printf("The radius of the round table is: %0.3Lf\n",0);
            continue;
        }
        s=(a+b+c)/2;
        r=sqrt((s-a)*(s-b)*(s-c)/s);
        printf("The radius of the round table is: %0.3Lf\n",r);
    }
    exit(0);
}

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.