Advertisement
Babul_420

10195 - The Knights Of The Round Table

Apr 4th, 2018
330
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.44 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. #include<math.h>
  3. using namespace std;
  4. int main()
  5. {
  6.     double a,b,c,s,r;
  7.     while(scanf("%lf%lf%lf", &a, &b, &c) !=EOF)
  8.     {
  9.         if(a==0 || b==0 || c==0)
  10.          printf("The radius of the round table is: 0.000\n");
  11.         else{s=(a+b+c)/2;
  12.         r=(s-a)*(s-b)*(s-c);
  13.         r=r/s;
  14.         r=sqrt(r);
  15.         printf("The radius of the round table is: %0.3lf\n",r);
  16.         }
  17.     }
  18.     return 0;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement