UVa Problem 10347 ( Medians) Solution

Problem Solving, UVa

 

#include <bits/stdc++.h>

#include <math.h>



using namespace std;



int main()

{



 double  a,b,c,ans,s;



 while(scanf("%lf %lf %lf",&a,&b,&c) == 3 )

 {



 s=(a+b+c)/2;

 ans=sqrt(s*(s-a)*(s-b)*(s-c));

 if(ans>0)

 printf("%.3lf\n",ans*(4.0/3.0));

 else

 {

 ans=-1;

 printf("%.3lf\n",ans);

 }

 }



return 0;

}

 

0 Comments

You may find interest following article

Complete Guide: Create Laravel Project in Docker Without Local Dependencies

Create Laravel Project Through Docker — No Need to Install PHP, MySQL, or Apache on Your Local Machine In this tutorial, I’ll show you how to create and run a full Laravel project using Docker containers. That means you won’t have to install PHP, MySQL, or Apache locally on your computer. By the end of this guide, you’ll have a fully functional Laravel development...