Program Lab_5_1; uses crt, Types, Poligon, IOGeom, GrGeom; (**************************************** * Cea mai apropiata pereche de puncte: * Algoritmul direct ****************************************) const filein = 'Puncte.txt'; var p: TabelPuncte; nr, p1, p2: integer; ro: real; begin clrscr; { Citirea coordonatelor punctelor de la tastatura } if nr = 0 then nr := introdu_puncte(p); { Afisarea coordonatelor } clrscr; write_puncte(p, nr); {Determinarea perechii celei mai apropiate de puncte si a distantei dintre acestea} ro := aproape(p, nr, p1, p2); { Afisarea rezultatului } writeln; writeln('Punctele cele mai apropiate sunt:'); write('p', p1); write_punct(p[p1], ''); writeln; write('p', p2); write_punct(p[p2], ''); writeln; writeln('ro = ', ro:5:2); readkey; drow_set_puncte(p, nr, GREEN); drow_segment(p[p1], p[p2]); readkey; end.