Advertisement
mdgaziur001

discussion on toph

Dec 13th, 2019
144
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement