9.已知三边计算三角形的面积公式

 1 #include <stdio.h>
 2 #include <stdlib.h>
 3 #include <math.h>
 4 
 5 int main()
 6 {
 7     float  a,b,c,s,area;
 8     scanf("%f%f%f",&a,&b,&c);
 9     s = (a+b+c)/2;                //已知三边计算三角形面积公式
10     area = sqrt(s*(s-a)*(s-b)*(s-c));  
11     printf("%f",area);
12     return 0;
13 }

 

posted @ 2019-01-11 19:06  小孢子  阅读(1147)  评论(0)    收藏  举报