三角形面积之海伦公式

这里写图片描述
这里写图片描述
这里写图片描述
这里写图片描述

CODE

#include<stdio.h>
#include <math.h>
int main()
{
    int a,b,c;
    float p,s;
    scanf("%d%d%d",&a,&b,&c);
    if(a>=b+c || b>=a+c || c>=a+b)
        return 0;
    else
    {
        p=(float)(a+b+c)/2;
        s=(float)sqrt(p*(p-a)*(p-b)*(p-c));
        printf("%.2f",s);
        return 0; 
    }
  }

猜你喜欢

转载自blog.csdn.net/ac__go/article/details/78388699