Click Here to go back to the homepage.

Janitor Troubles Solution:


#include <iostream>
#include <math.h>
#include <stdio.h>
int main(){
    long a, b, c, d;
    std::cin >> a >> b >> c >> d;
    double semiperimeter = (a+b+c+d) / 2.0;
    double ans = sqrt((semiperimeter-a)*(semiperimeter-b)*(semiperimeter-c)*(semiperimeter-d));
    printf("%lf", ans);
    return 0;
}