Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Your code has some problems. Here's the fixed one:
- #include<bits/stdc++.h>
- using namespace std;
- int main()
- {
- int T,i;
- double area,a,b,c,s,result;
- cin>>T;
- for(i=0;i<T;i++)
- {
- cin>>a>>b>>c;
- if(a+b<c || a+c<b || b+c<a)
- {
- cout<<"Oh, No!"<<endl;
- }
- else
- {
- s=(a+b+c)/2;
- result=sqrt(s*((s-a)*(s-b)*(s-c)));
- cout<<fixed<<setprecision(2)<<result<<endl;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement