uses crt;
var ax, ay, bx, by, cx, cy, ha, hb, hc: real;
procedure heights (ax, ay, bx, by, cx, cy: real; var ha, hb, hc: real);
var s, a, b, c, p: real;
begin
a:=sqrt (sqr(bx-ax)+sqr(by-ay));
b:=sqrt (sqr(cx-bx)+sqr(cy-by));
c:=sqrt (sqr(ax-cx)+sqr(ay-cy));
p:=(a+b+c)/2;
s:=sqrt(p*(p-a)*(p-b)*(p-c));
ha:=(2*s)/a;
hb:=(2*s)/b;
hc:=(2*s)/c;
end;
begin
clrscr;
write ('vvedite koordinati vershin treugolnika: ');
readln (ax, ay, bx, by, cx, cy);
heights (ax, ay, bx, by, cx, cy, ha, hb, hc);
writeln ('visoti treugolnika ABC = ',ha,' ',hb,' ',hc);
end.