求三角形面积 (sdut oj)
2017-01-27 20:25
337 查看
求三角形面积
Time Limit: 1000MS Memory Limit: 65536KB
Problem Description
已知三角形的边长a、b和c,求其面积。
Input
输入三边a、b、c。
Output
输出面积,保留3位小数。
Example Input
1 2 2.5
Example Output
0.950
Hint
Author
参考代码
#include<stdio.h> #include<math.h> double f(double a,double b,double c) { double s; double p; p = (a + b + c) / 2; s = sqrt(p * (p - a) * (p - b) * (p - c)); return s; } int main() { double a,b,c; double s; scanf("%lf%lf%lf",&a,&b,&c); s = f(a,b,c); printf("%.3lf",s); return 0; }
相关文章推荐
- 计算三角形面积周长
- 求三角形面积
- Lifting the Stone(三角形面积、重心 )
- C语言实现输入三角形两边边长以及夹角求三角形第三边边长与面积
- 计算三角形的面积
- 正三角形的外接圆面积
- 用向量坐标乘得出三角形的面积
- 正三角形的外接圆面积
- nyoj 三角形面积
- 5.4.3 果园里的树 // 判断点是否在圆内 三角形的有向面积,注意正负
- Linux下的C语言编程——求三角形面积
- 第十九周oj刷题:三角形面积和体积
- 已知三角形的三个点坐标,求三角形的面积
- UVA 10347 || Medians(中线组成的三角形面积是原三角形的3/4
- 根据边长计算三角形的面积
- 检测两个三角形是否有重叠面积/相交的方法
- 求三角形的面积
- 三角形面积计算
- 设计一个三角形类,能够输入三角形的三个顶点,求出其面积、周长,并判断其是否为直角三角形和等腰三角形。
- 设计一个三角形类,能够输入三角形的三个顶点,求出其面积、周长,并判断其是否为直角三角形和等腰三角形