View Code of Problem 24

#include<iostream>
#include<cmath>
using namespace std;
int main(){
	double a,b,c;
	cin>>a>>b>>c;
	double S,x;
	if(a+b>c&&b+c>a&&c+a>b){
          x=(a+b+c)/2;
          S=sqrt(x*(x-a)*(x-b)*(x-c));
        }
        printf("%.2f",S);
}

Double click to view unformatted code.


Back to problem 24