Files
OI-source/history_source/信息学奥赛一本通/1.2.6.6.cpp
2023-08-03 09:22:52 +08:00

26 lines
431 B
C++

#include<cstdio>
#include<cmath>
using namespace std;
struct Point
{
double x,y;
};
double lenth(Point A,Point B)
{
double a=abs(A.x-B.x),b=abs(A.y-B.y),c=sqrt(a*a+b*b);
return c;
}
int main()
{
Point A,B,C;
scanf("%lf%lf%lf%lf%lf%lf",&A.x,&A.y,&B.x,&B.y,&C.x,&C.y);
double a,b,c;
a=lenth(A,B);
b=lenth(B,C);
c=lenth(C,A);
double p=(a+b+c)/2.0;
double ans=sqrt(p*(p-a)*(p-b)*(p-c));
printf("%.2lf\n",ans);
return 0;
}