View Code of Problem 24

#include<stdio.h>
#include<math.h>
int main()
{
	float a,b,c;
	while(scanf("%f %f %f",&a,&b,&c)!=EOF){
		float max =a,x=b,y=c;
		if(max<b){
			max = b;
			x=a;	
		} 
		if(max<c){
			max = c;
			x=a;
			y=b;
		}
		
		float k = (pow(x,2)-pow(y,2)+pow(max,2))/(2*max);
		float h = sqrt(pow(x,2)-pow(k,2));
		printf("%.2f\n",h*max/2);
	}
	
		
}

Double click to view unformatted code.


Back to problem 24