program rajzolo; uses newdelay,crt,graph; type pont=record x:integer; y:integer; t:integer; end; tomb=array[1..4] of pont; var a,b,c,d:integer; t:tomb; kf,ka,kj,kb:integer; x1,x2,y1,y2:integer; mp1,mp2,mp3,mp4:pont; x,y:integer; function GraphInit:boolean; var gd,gm:integer; utv:string; begin utv:=''; DetectGraph(gd,gm); {$I-} InitGraph(gd,gm,utv); while (GraphResult<>grOK) and (utv<>'exit') do begin {writeln('K‚rem az utvonalat a BGI filehoz vagy exit');} utv:='c:\aaa\tp\bgi'; {readln(utv);} DetectGraph(gd,gm); Initgraph(gd,gm,utv); end; GraphInit:=(utv<>'exit'); {$I+} end; procedure rajz(a,b,c,d:integer); begin line(a,c,b,c); line(a,d,b,d); line(a,c,a,d); line(b,c,b,d); end; procedure egyenes(x1,y1,x2,y2:integer); var t,x,y:integer; begin for t:=1 to 20 do begin x:=(1-t)*x1+t*x2; y:=(1-t)*y1+t*y2; putpixel(x,y,red); end; end; procedure metszespont1; var x,y:integer; t:integer; begin x:=a; t:=round((x1-x)/(x1-x2)); {t-re kifejezve x:=(1-t)*x1+t*x2;} y:=(1-t)*y1+t*y2; mp1.x:=a; mp1.y:=y; mp1.t:=t; end; procedure metszespont2; var x,y:integer; t:integer; begin y:=c; t:=round((y1-y)/(y1-y2)); {t-re kifejezve x:=(1-t)*x1+t*x2;} x:=(1-t)*x1+t*x2; mp2.x:=x; mp2.y:=c; mp2.t:=t; end; procedure metszespont3; var x,y:integer; t:integer; begin y:=d; t:=round((y1-y)/(y1-y2)); {t-re kifejezve x:=(1-t)*x1+t*x2;} x:=(1-t)*x1+t*x2; mp3.x:=x; mp3.y:=d; mp3.t:=t; end; procedure metszespont4; var x,y:integer; t:integer; begin x:=b; t:=round((x1-x)/(x1-x2)); {t-re kifejezve x:=(1-t)*x1+t*x2;} y:=(1-t)*y1+t*y2; mp4.x:=b; mp4.y:=y; mp4.t:=t; end; procedure tombfeltolt; begin t[1]:=mp1; t[2]:=mp2; t[3]:=mp3; t[4]:=mp4; end; procedure csere(var a,b:pont); var s:pont; begin s:=a; a:=b; b:=s; end; procedure rendez(var t:tomb;n:integer); var i,j,min:integer; begin min:=1; for i:=1 to n-1 do begin for j:=i+1 to n do if t[j].t