View Code of Problem 24

#include<iostream>
#include<cmath>

using namespace std;

int main(void){
    int a,b,c;
    while(scanf("%d%d%d",&a,&b,&c)!=EOF){
        double s=(a+b+c)/2.0;
        double area=sqrt(s*(s-a)*(s-b)*(s-c));
        printf("%.2lf\n",area);
    }
}

Double click to view unformatted code.


Back to problem 24