Advertisement
steffffffan

P2_12

Nov 20th, 2022
932
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Prolog 0.20 KB | None | 0 0
  1. % 12.
  2. % a) Sa se inlocuiasca toate aparitiile unui element dintr-o lista cu un
  3. % alt element.
  4.  
  5. repl([],_,_,[]):-!.
  6. repl([E|T],E,N,[N|R]):-repl(T,E,N,R),!.
  7. repl([H|T],E,N,[H|R]):-H\=E,repl(T,E,N,R).
  8.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement