求三角形面积
#include<math.h>
int main()
{
double a, b, c, s, min;
scanf("%lf%lf%lf", &a, &b, &c);
s = 1.0 / 2 * (a + b + c);
min = sqrt(s * (s - a) * (s - b) * (s - c));//sqrt开根号
printf("%7.2f", min);
return 0;
}
double浮点型
求三角形面积
#include<math.h>
int main()
{
double a, b, c, s, min;
scanf("%lf%lf%lf", &a, &b, &c);
s = 1.0 / 2 * (a + b + c);
min = sqrt(s * (s - a) * (s - b) * (s - c));//sqrt开根号
printf("%7.2f", min);
return 0;
}
double浮点型