文章
82
粉丝
344
获赞
28
访问
695.9k
#include <iostream>
#include <stdio.h>
#include <math.h>
using namespace std;
int main(){
int x1,y1,x2,y2,x3,y3;
while(scanf("%d%d%d%d%d%d",&x1,&y1,&x2,&y2,&x3,&y3)!=EOF){
double a=sqrt((double)(x1-x2)*(x1-x2)+(double)(y1-y2)*(y1-y2));
// cout<<a<<endl;
double b=sqrt((double)(x1-x3)*(x1-x3)+(double)(y1-y3)*(y1-y3));
//cout<<b<<endl;
double c=sqrt((double)(x2-x3)*(x2-x3)+(double)(y2-y3)*(y2-y3));
//cout<<c<<endl;
double p=(a+b+c)/2;
double s=sqrt(p*(p-a)*(p-b)*(p-c));
printf("%.2lf",s);
cout<<endl;
}
return 0;
}
登录后发布评论
暂无评论,来抢沙发