UVA Problem 11152 Solution

Problem Solving, UVa

#include <bits/stdc++.h>

#define pi 2*acos(0)



using namespace std;

int main()

{

    double s,a,b,c,tri_area,red_out,red_in;

    double area_circum,area_inscribed,area_triangle;

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

    {

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

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



        red_out=((a*b*c)/(4*tri_area));

        red_in=(tri_area/s);



        area_circum=(pi*pow(red_out, 2))-tri_area;

        area_inscribed=(pi*pow(red_in, 2));

        tri_area=tri_area-area_inscribed;



        printf("%.4lf %.4lf %.4lf\n", area_circum, tri_area, area_inscribed);

    }

}

 

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...