Help write on Pascal task.
Let L be a list of integers. Describe the procedure that includes the list 0 for the first negative number. If there are no negative numbers in L, the list does not change.
The difficulty, for me, is how to create a link with zero and include it in the list after the negative element ...
type list=^elem; elem=record data:integer; next:list; end; procedure otr(l:list); var f:boolean;p:list; begin f:=false;p:=l; while (p<>nil)and not f do if p^.data<0 then begin {Вот здесь не знаю как написать} end else p:=p^.next; end;
elem? Of course, dynamically, withnew. Can you continue? - VladD