C语言初学 计算三角形面积问题

#include<stdio.h>

#include<math.h>

#include<stdlib.h>

int main()

{

float a,b,c,s,area;

scanf("%f%f%f",&a,&b,&c);

s=1.0/2*(a+b+c);

area=sqrt(s*(s-a)*(s-b)*(s-c));

printf("a=%7.2f,b=%7.2f,c=%7.2f,s=%7.2f ",a,b,c,s);

printf("area=%7.2f ",area);

return 0;

}

原文地址:https://www.cnblogs.com/lj-1568/p/4367611.html