with text_io, Alakzatok, Korok, Teglalapok.Negyzetek; use text_io, Alakzatok, Korok, Teglalapok, Teglalapok.Negyzetek; procedure Proba is package natio is new integer_io(natural); use natio; alakzatszam: NATURAL; dintipus: CHARACTER; NEM_TAMOGATOTT_TIPUS: exception; begin Get(CURRENT_INPUT,alakzatszam); declare type AP is access Alakzat'class; a: array (1..alakzatszam) of AP; begin for i in a'range loop Get(CURRENT_INPUT,dintipus); case dintipus is when 'K' => a(i) := new Kor; when 'T' => a(i) := new Teglalap; when 'N' => a(i) := new Negyzet; when others => raise NEM_TAMOGATOTT_TIPUS; end case; a(i).all := Beolvas; Kiir(a(i).all); New_Line; end loop; end; end Proba;