文章
7
粉丝
116
获赞
2
访问
8.0k
#include <stdio.h>
int main(){
double x1,y1,x2,y2,x3,y3;
while(scanf("%lf%lf%lf%lf%lf%lf",&x1,&y1,&x2,&y2,&x3,&y3)!=EOF){
double a=sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));
double b=sqrt((x1-x3)*(x1-x3)+(y1-y3)*(y1-y3));
double c=sqrt((x2-x3)*(x2-x3)+(y2-y3)*(y2-y3));
double p=(a+b+c)/2;
double s=sqrt(p*(p-a)*(p-b)*(p-c));
printf("%.2lf\n",s);
}
return 0;
}
登录后发布评论
暂无评论,来抢沙发