program zB3_3 uses crt const 01 tochnost sravneniya veshestvennih chis

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
program zB3_3;
uses crt;
const t=0.01; {tochnost' sravneniya veshestvennih chisel}
function Plosh(x1,y1,x2,y2,x3,y3:real):real;{ opredelenie ploshadi}
begin
Plosh:=abs((x1-x2)*(y3-y2)-(y1-y2)*(x3-x2))/2;
end;
var x1,y1,x2,y2,x3,y3,tx,ty,s:real;
begin
clrscr;
writeln('Vvedite koordinati vershin treugolnika:');
writeln('Vershina 1:');readln(x1,y1);
writeln('Vershina 2:');readln(x2,y2);
writeln('Vershina 3:');readln(x3,y3);
if Plosh(x1,y1,x2,y2,x3,y3)<t then
write('Eto ne treugolnik!')
else
begin
writeln('Vvedite koordinati tochki:');
readln(tx,ty);
s:= Plosh(x1,y1,x2,y2,tx,ty)+ Plosh(x1,y1,tx,ty,x3,y3)+ Plosh(tx,ty,x2,y2,x3,y3);
if abs(Plosh(x1,y1,x2,y2,x3,y3)-s)<t then
write('Tochka prinadlegit treugolniku!')
else write('Tochka ne prinadlegit treugolniku!');
end;
readln
end.