Symmetric difference: Difference between revisions
Content added Content deleted
Not a robot (talk | contribs) (Add SETL) |
(Demonstrating Delphi/Object Pascal's 'symmetric difference' operator) |
||
Line 1,180: | Line 1,180: | ||
ReadLn; |
ReadLn; |
||
END.</syntaxhighlight> |
END.</syntaxhighlight> |
||
Delphi/Object Pascal actually has a 'Symmetric Difference' operator `> <`: |
|||
<syntaxhighlight lang="pascal"> |
|||
program SymmetricDifference; |
|||
type |
|||
charSet = set of Char; |
|||
var |
|||
s1, s2, s3: charSet; |
|||
ch: char; |
|||
begin |
|||
s1 := ['a', 'b', 'c', 'd']; |
|||
s2 := ['c', 'd', 'e', 'f']; |
|||
s3 := s1 >< s2; |
|||
for ch in s3 do |
|||
write(ch, ' '); |
|||
writeLn; |
|||
end. |
|||
</syntaxhighlight> |
|||
Output: |
|||
<pre> |
|||
a b e f |
|||
</pre> |
|||
=={{header|Déjà Vu}}== |
=={{header|Déjà Vu}}== |