uses crt;
const n=100;
type
TVector = array [1..n] of integer;
var
B: TVector;
procedure VvodMas;
var
i: integer;
begin
for i:=1 to n do B[i] := random(100);
end;
function LongVector(x1,y1,x2,y2: integer): real;
begin
LongVector := sqrt(sqr(x2-x1)+sqr(y2-y1));
end;
function UravPrjam(x,x1,y1,x2,y2: integer): real;
begin
if x2<>x1
then UravPrjam := (((x-x1)*(y2-y1))/(x2-x1))+y1
else UravPrjam := x;
end;
function RavnobedTreug(x1,y1,x2,y2,x3,y3: integer): boolean;
var
d1,d2,d3: real;
begin
RavnobedTreug := false;
d1 := LongVector(x1,y1,x2,y2);
d2 := LongVector(x1,y1,x3,y3);
d3 := LongVector(x2,y2,x3,y3);
if (d1=d2)or(d1=d3)or(d2=d3)
then RavnobedTreug := true;
end;
function Treug(x1,y1,x2,y2,x3,y3: integer): boolean;
var
py1,py2: real;
x: integer;
begin
Treug := true;
x := random(100);
py1 := UravPrjam(x,x1,y1,x2,y2);
py2 := UravPrjam(x,x2,y2,x3,y3);
if py1=py2 then Treug := False;
end;
procedure ProvAr;
var
i,j,m: integer;
begin
for i:= 1 to n do
for j:= 3 to n do
for m:= 5 to n do
if odd(i)and odd(j)and odd(m) then
if (i<j)and(j<m) then
if Treug(a[i],a[i+1],a[j],a[j+1],a[m],a[m+1]) then
if RavnobedTreug(a[i],a[i+1],a[j],a[j+1],a[m],a[m+1]) then
writeln('(',a[i],'-',a[i+1],',',a[j],'-',a[j+1],',',a[m],'-',a[m+1],')');
end;
begin
randomize;
clrscr;
VvodMas;
ProvAr;
readln;
end.
const n=100;
type
TVector = array [1..n] of integer;
var
B: TVector;
procedure VvodMas;
var
i: integer;
begin
for i:=1 to n do B[i] := random(100);
end;
function LongVector(x1,y1,x2,y2: integer): real;
begin
LongVector := sqrt(sqr(x2-x1)+sqr(y2-y1));
end;
function UravPrjam(x,x1,y1,x2,y2: integer): real;
begin
if x2<>x1
then UravPrjam := (((x-x1)*(y2-y1))/(x2-x1))+y1
else UravPrjam := x;
end;
function RavnobedTreug(x1,y1,x2,y2,x3,y3: integer): boolean;
var
d1,d2,d3: real;
begin
RavnobedTreug := false;
d1 := LongVector(x1,y1,x2,y2);
d2 := LongVector(x1,y1,x3,y3);
d3 := LongVector(x2,y2,x3,y3);
if (d1=d2)or(d1=d3)or(d2=d3)
then RavnobedTreug := true;
end;
function Treug(x1,y1,x2,y2,x3,y3: integer): boolean;
var
py1,py2: real;
x: integer;
begin
Treug := true;
x := random(100);
py1 := UravPrjam(x,x1,y1,x2,y2);
py2 := UravPrjam(x,x2,y2,x3,y3);
if py1=py2 then Treug := False;
end;
procedure ProvAr;
var
i,j,m: integer;
begin
for i:= 1 to n do
for j:= 3 to n do
for m:= 5 to n do
if odd(i)and odd(j)and odd(m) then
if (i<j)and(j<m) then
if Treug(a[i],a[i+1],a[j],a[j+1],a[m],a[m+1]) then
if RavnobedTreug(a[i],a[i+1],a[j],a[j+1],a[m],a[m+1]) then
writeln('(',a[i],'-',a[i+1],',',a[j],'-',a[j+1],',',a[m],'-',a[m+1],')');
end;
begin
randomize;
clrscr;
VvodMas;
ProvAr;
readln;
end.