Program spiski; Uses Crt; Type Tinf = Char; Tptr = ^Tlist; Tlist = record inf : Tinf; next : Tptr; end; Var A, B : Tptr; n : char; Procedure Create_list (Var L : Tptr); Var q, p : Tptr; e : Tinf; Begin L := nil; while not eoln do Begin New(p); Read(e); p^.inf := e; p^.next := nil; if L = nil then L := p; q := p; end; Readln end; Procedure New_list (Var L1, L2 : Tptr); Var pl_1, pl_2 : Tptr; Begin pl_1 := nil; pl_2 := L1; While (pl_1 <> nil) and (L2^.inf > pl_1^.inf) do pl_1 := pl_2; pl_2 := pl_2^.next; If (pl_1 = nil) then Begin L2^.next := L1; L1 := L2; end else Begin L2^.next := pl_1^.next; pl_1^.next := L2; Writeln (pl_1^.inf); end; end; Procedure Delete_list (Var h : Tptr); Var p : Tptr; Begin While h <> nil do Begin p := h; h := h^.next; Dispose (p); end; end; BEGIN Clrscr; Writeln ('Enter spisok A'); Create_list(A); Writeln ('Enter spisok B'); Create_list(B); Writeln ('Okonchatelniy spisok C'); New_List(A, B); Delete_list (A); Delete_list(B); readln; END.