C.实验2_5_求三角形的面积
#include<stdio.h>
#include <math.h>
int main() {
int a, b, c;
double s, Ace;
scanf("%d%d%d", &a, &b, &c);
if ((a + b) > c && (a + c) > b && (b + c) > a) {
if ((a + b + c) % 2 == 0)
s = (a + b + c) / 2;
if ((a + b + c) % 2 == 1)
s = (a + b + c) / 2 + 0.5;
Ace = sqrt(s * (s - a) * (s - b) * (s - c));
printf("%.3lf", Ace);
} else
printf("The edges cannot make up of a triangle.");
return 0;
}