View Code of Problem 24

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main(){
    
    int n1 = 0;
    int n2 = 0;
    int n3 = 0;
    while(scanf("%d %d %d",&n1,&n2,&n3)!=EOF){
        double p = (n1+n2+n3)/2.0;
        printf("%.2f\n",sqrt(p*(p-n1)*(p-n2)*(p-n3)));
    }
    return 0;
}

Double click to view unformatted code.


Back to problem 24