with text_io; use text_io; package body Grafok is package NATIO is new INTEGER_IO(NATURAL); use NATIO; function Beolvas ( f: FILE_TYPE := CURRENT_INPUT ) return PGraf is meret: NATURAL; begin Get(f,meret); declare p: PGraf := new Graf(meret); sor, oszlop: POSITIVE; begin while not End_Of_File(f) loop Get(f,sor); while not End_Of_Line(f) loop Get(f,oszlop); p.szomszed(sor,oszlop) := true; end loop; Skip_Line(f); end loop; return p; end; exception when others => raise HIBAS_INPUT; --kis altalanositas :-) end Beolvas; procedure Kiir ( g: in Graf; f: in FILE_TYPE := CURRENT_OUTPUT ) is begin for i in 1..g.pontszam loop for j in 1..g.pontszam loop if g.szomszed(i,j) then Put(f,'*'); else Put(f,'.'); end if; end loop; New_Line(f); end loop; end Kiir; end Grafok;