文章
94
粉丝
0
获赞
572
访问
17.7k
#include <bits/stdc++.h>
using namespace std;
int main()
{
double x1,y1,x2,y2,x3,y3;
while(cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3){
double a = sqrt(pow((x1 - x2),2) + pow((y1-y2),2));
double b = sqrt(pow((x1 - x3),2) + pow((y1-y3),2));
double c = sqrt(pow((x3 - x2),2) + pow((y3-y2),2));
double p = (a + b + c) / 2.0;
double result = sqrt(p * (p - a) * (p - b) * (p - c));
printf("%.2f\n",result);
}
return 0;
}
登录后发布评论
暂无评论,来抢沙发