文章
34
粉丝
109
获赞
7
访问
21.2k
#include <stdio.h>
#include <math.h>
double len(int x1, int y1, int x2, int y2)
{
return sqrt((double)(x2 - x1) * (x2 - x1) + (double)(y2 - y1) * (y2 - y1));
}
int main()
{
int q, w, e, r, t, y;
while (scanf("%d%d%d%d%d%d", &q, &w, &e, &r, &t, &y) != EOF)
{
double a = len(q, w, e, r);
double b = len(q, w, t, y);
double c = len(e, r, t, y);
double p = (a + b + c) / 2;
printf("%.2f\n", sqrt(p * (p - a) * (p - b) * (p - c)));
}
return 0;
}
登录后发布评论
暂无评论,来抢沙发