pascalabcnet/TestSamples/CompilationSamples/Sets2.pas
Бондарев Иван e6e67c193c initial commit
2015-05-14 21:35:07 +02:00

15 lines
503 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.

// Работа с множествами
// Базовый тип для множества может быть произвольным
var
s1: set of string := ['Иванов','Попов','Сидорова','Петров'];
s2: set of string := ['Козлов','Петров','Иванов'];
begin
writeln('Множество s1: ',s1);
writeln('Множество s2: ',s2);
writeln('Объединение множеств s1 и s2: ',s1+s2);
writeln('Пересечение множеств s1 и s2: ',s1*s2);
writeln('Разность множеств s1 и s2: ',s1-s2);
Include(s1,'Умнов');
Exclude(s1,'Иванов');
writeln('Множество s1: ',s1);
end.