#t217. 海伦公式
海伦公式
Heron's Formula
Problem Description
Given the lengths of the three sides of a triangle, compute its area.
Input Format
The input is three real numbers: the lengths of the three sides.
Output Format
Output the area of the triangle, kept to 2 decimal places.
Sample Input
3 4 5
Sample Output
6.00
Hint
- The sides may be decimals — pick the right type.
- Apply the formula: first compute , then compute .
sqrtis in<cmath>. Keep 2 decimal places. - Check against the sample:
3 4 5→6.00.
Heron's formula: let the three sides of the triangle be , set , then the area of the triangle .