uses crt;
var xa,ya,xb,yb,xc,yc:integer;
ab,ac,bc,ah,p,s:real;
begin
clrscr;
write('Nhap toa do diem A:'); readln(xa,ya);
write('Nhap toa do diem B:'); readln(xb,yb);
write('Nhap toa do diem C:'); readln(xc,yc);
ab:=sqrt(sqr(xa-xb)+sqr(ya-yb));
ac:=sqrt(sqr(xa-xc)+sqr(ya-yc));
bc:=sqrt(sqr(xb-xc)+sqr(yb-yc));
if (ab+ac>bc) and (ac+bc>ab) and (ab+bc>ac) then
begin
p:=(ab+ac+bc)/2;
s:=sqrt(p*(p-ab)*(p-ac)*(p-bc));
ah:=(2*s)/bc;
writeln('Khoang cach tu A den BC la: ',ah:4:2);
end
else writeln('Khong tinh duoc khoang cach tu A den BC');
readln;
end.