Sunday, 18 November 2018

uva problem 11152 Colourful Flowers solution

  1. #include<bits/stdc++.h>
  2. #include<cmath>
  3. using namespace std;
  4. int main()
  5. {
  6.     double a,b,c,s,r,red,rr,v,R;
  7.     while(cin>>a>>b>>c){
  8.         s=a+b+c;
  9.         s=s/2;
  10.         rr=sqrt(s*(s-a)*(s-b)*(s-c));
  11.         r=rr/s;
  12.         red=acos(-1);
  13.         red=red*r*r;
  14.         v=rr-red;
  15.         R=(a*b*c)/(4*rr);
  16.         R=acos(-1)*R*R;
  17.         R=R-rr;
  18.         printf("%0.4lf %0.4lf %0.4lf\n",R,v,red);
  19.     }
  20.     return 0;
  21. }

No comments:

Post a Comment

variable declaration of c program

#include <stdbool.h> #include<bits/stdc++.h> #include <stdio.h> #include <string.h> #include <std...