#include<iostream>
#include<cstdio>
#include<cmath>
#include<cstring>
using namespace std;
int main()
{
double a, b, c;
double rad, s, v;
while(scanf("%lf%lf%lf", &a, &b, &c)==3)
{
if(a<=0 || b<=0 || c<=0)
{
printf("The radius of the round table is: 0.000\n");
continue;
}
s = (a+b+c)/2;
v = sqrt(s*(s-a)*(s-b)*(s-c));
rad = (v/s);
printf("The radius of the round table is: %0.3lf\n", rad);
}
}
#include<cstdio>
#include<cmath>
#include<cstring>
using namespace std;
int main()
{
double a, b, c;
double rad, s, v;
while(scanf("%lf%lf%lf", &a, &b, &c)==3)
{
if(a<=0 || b<=0 || c<=0)
{
printf("The radius of the round table is: 0.000\n");
continue;
}
s = (a+b+c)/2;
v = sqrt(s*(s-a)*(s-b)*(s-c));
rad = (v/s);
printf("The radius of the round table is: %0.3lf\n", rad);
}
}
No comments:
Post a Comment