Program spiski; Uses Crt; Type Tinf = Char; Tptr = ^Tlist; Tlist = record inf : Tinf; next : Tptr; end; Var A, B : Tptr; 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 (L1, L2 : Tptr); Var pl_1, pl_2 : tptr; Begin pl_1 := L1; pl_2 := L2; While (pl_1 <> nil) and (pl_2 <> nil) do Begin If L1^.inf = pl_2^.inf then Begin pl_1 := L1; While (pl_1 <> nil) and (pl_2 <> nil) and (pl_1^.inf = pl_2^.inf) do Begin pl_1 := pl_1^.next; pl_2 := pl_2^.next; End; End else pl_2 := pl_2^.next; 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.