求三角形面积.c 199 B

123456789101112131415
  1. #include <stdio.h>
  2. #include <math.h>
  3. int main() {
  4. int a,b,c;
  5. scanf("%d %d %d",&a,&b,&c);
  6. double s,S;
  7. s = (a+b+c)/2.0;
  8. S = sqrt(s * (s-a) * (s-b) * (s-c));
  9. printf("%.3lf",S);
  10. return 0;
  11. }