Program lab2; Uses Crt; Type El1=^Zap1; Zap1=Record Inf1:Integer; Next1:El1; End; El2=^Zap2; Zap2=Record Inf2:Integer; Next2:El2; End; El3=^Zap3; Zap3=Record Inf3:Integer; Next3:El3; End; Var First1,p1,q1,r1,t1:El1; First2,p2,q2,r2,t2:El2; First3,p3,q3,r3,t3:El3; i:integer; Procedure Form_List(Var first1:El1; first2:El2 ;first3:El3); Begin first1:=nil; first2:=nil; first3:=nil; End; Procedure Create_New(Var p2:El2; p3:El3); Begin New(p2); New(p3); End; Procedure Create_El(var p2:El2; p3:El3); Begin Randomize; p2^.inf2:=Random(10)+2; p3^.inf3:=Random(10)+6; p2^.next2:=nil; p3^.next3:=nil; End; Procedure Ins_Beg_List2 (p2:el2; Var first2:el2); Begin If first2=nil Then Begin first2:=p2; p2^.next2:=first2; End Else Begin first2:=p2; p2^.next2:=first2; End; End; Procedure Ins_End_List2 (p2:el2; Var first2:el2); Begin If first2=nil Then first2:=p2 Else Begin q2:=first2; While q2^.next2<>nil Do q2:=q2^.next2; p2^.next2:=nil; End; End; Procedure Print_List2(p2:el2); Begin p2:=first2; While p2<>nil Do Begin Write(' ',p2^.inf2); p2:=p2^.next2; End; ReadLn; End; Begin ClrScr; Form_List(first1,first2,first3); Create_New(first2,first3); for i:=1 to 10 do begin Create_El(p2,p3); end; Print_List2(p2); End.