View Code of Problem 24

// s = ( a + b + c) / 2

#include <stdio.h>
#include <math.h>

int main()
{
	int a,b,c;
	double s,area;
	scanf("%d%d%d",&a,&b,&c);
	s = ( a + b + c) / 2;
	area = sqrt( s * ( s - a ) * ( s - b ) * ( s - c ) );
	printf("三角形面积是:%f\n",area);

	return 0;
}

Double click to view unformatted code.


Back to problem 24