Advertisement
mdgaziur001

discussion on toph

Dec 13th, 2019
344
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.39 KB | None | 0 0
  1. Your code has some problems. Here's the fixed one:
  2. #include<bits/stdc++.h>
  3. using namespace std;
  4. int main()
  5. {
  6.     int T,i;
  7.     double area,a,b,c,s,result;
  8.     cin>>T;
  9.     for(i=0;i<T;i++)
  10.     {
  11.         cin>>a>>b>>c;
  12.         if(a+b<c || a+c<b || b+c<a)
  13.         {
  14.             cout<<"Oh, No!"<<endl;
  15.         }
  16.         else
  17.         {
  18.             s=(a+b+c)/2;
  19.             result=sqrt(s*((s-a)*(s-b)*(s-c)));
  20.             cout<<fixed<<setprecision(2)<<result<<endl;
  21.         }
  22.     }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement