海伦公式:S = sqrt((l - a) * (l - b) * (l - c));其中l = (a + b + c) / 2;

#include<cstdio>
#include<iostream>
#include<cmath>
using namespace std;
int main() {
    double a, b, c, p;
    cin >> a >> b >> c;
    p = (a+b+c)/2;
    double area = sqrt(p*(p-a)*(p-b)*(p-c));
    printf("%.1lf", area); 
    return 0;
} 

 

posted on 2018-04-27 14:09  kindleheart  阅读(331)  评论(0编辑  收藏  举报