This repository has been archived on 2024-12-25. You can view files and clone it, but cannot push or open issues or pull requests.
2024-03-10 20:32:51 +03:00

27 lines
605 B
ObjectPascal
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// Использование LinkedList - двусвязного списка стандартной библиотеки - и его итератора
uses System.Collections,System.Collections.Generic;
procedure print(l: ICollection);
begin
foreach x: integer in l do
write(x,' ');
writeln;
end;
var l: LinkedList<integer> := new LinkedList<integer>;
begin
l.AddLast(3);
l.AddLast(5);
l.AddLast(7);
l.AddFirst(2);
print(l);
var a := new integer[10];
l.CopyTo(a,0);
print(a);
var lit: LinkedListNode<integer> := l.Find(5);
l.AddBefore(lit,777);
print(l);
end.