0 0 1 1 1 3 0 1 1 0 0 0 0 0 0 0 0 0
1.0 0.5
代码:
01.
#include<iostream>
02.
#include<math.h>
03.
#include<stdio.h>
04.
using
namespace
std;
05.
int
main()
06.
{
07.
int
x1,x2,x3,y1,y2,y3;
08.
double
a,b,c,p,s;
09.
while
(cin>>x1>>y1>>x2>>y2>>x3>>y3)
10.
{
11.
12.
if
(x1==0&&x2==0&&x3==0&&y1==0&&y2==0&&y3==0)
13.
break
;
14.
a =
sqrt
((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));
15.
b =
sqrt
((x1-x3)*(x1-x3)+(y1-y3)*(y1-y3));
16.
c =
sqrt
((x2-x3)*(x2-x3)+(y2-y3)*(y2-y3));
17.
p = (a + b + c)/2;
18.
s =
sqrt
(p*(p-a)*(p-b)*(p-c));
19.
printf
(
"%.1f\n"
,s);
20.
}
21.
return
0;
22.
23.
}