Symmetric difference: Difference between revisions
Content deleted Content added
→{{header|Kotlin}}: Updated example see https://github.com/dkandalov/rosettacode-kotlin for details |
No edit summary |
||
Line 1,895: | Line 1,895: | ||
in |
in |
||
{Show {SymDiff A B}}</lang> |
{Show {SymDiff A B}}</lang> |
||
=={{header|Pascal}}== |
|||
{{works with|FPC 3.0.2}} |
|||
<lang Pascal>PROGRAM Symmetric_difference; |
|||
TYPE |
|||
TName = (Bob, Jim, John, Mary, Serena); |
|||
TList = SET OF TName; |
|||
PROCEDURE Put(txt : String; ResSet : TList); |
|||
VAR |
|||
I : TName; |
|||
BEGIN |
|||
Write(txt); |
|||
FOR I IN ResSet DO Write(I,' '); |
|||
WriteLn |
|||
END; |
|||
VAR |
|||
ListA : TList = [John, Bob, Mary, Serena]; |
|||
ListB : TList = [Jim, Mary, John, Bob]; |
|||
BEGIN |
|||
Put('ListA -> ', ListA); |
|||
Put('ListB -> ', ListB); |
|||
Put('ListA >< ListB -> ', ListA >< ListB); |
|||
Put('ListA - ListB -> ', ListA - ListB); |
|||
Put('ListB - ListA -> ', ListB - ListA); |
|||
ReadLn; |
|||
END.</lang> |
|||
{{out}} |
|||
<pre>ListA -> Bob John Mary Serena |
|||
ListB -> Bob Jim John Mary |
|||
ListA >< ListB -> Jim Serena |
|||
ListA - ListB -> Serena |
|||
ListB - ListA -> Jim</pre> |
|||
=={{header|PARI/GP}}== |
=={{header|PARI/GP}}== |