View Code of Problem 24

#include <iostream>
#include <sstream>
#include <stdio.h>
#include <string>
#include <math.h>
#include <algorithm>
#include <stdlib.h>
#include <stack>
#include <map>
#include <set>
#include <queue>
using namespace std;



int main()
{
    #ifdef  ONLINE_JUDGE
    #else
    freopen("1.txt","r",stdin);
    #endif

    double a,b,c;
    cin>>a>>b>>c;
    double p=(a+b+c)*1.0/2;

    double ans=sqrt(p*(p-a)*(p-b)*(p-c));
    printf("%.2lf",ans);


    return 0;
}

Double click to view unformatted code.


Back to problem 24