RosettaCodeData/Task/Comma-quibbling/XPL0/comma-quibbling.xpl0
2015-02-20 09:02:09 -05:00

17 lines
302 B
Text

include c:\cxpl\codes;
proc Quibble(N, S);
int N, S;
int I;
[ChOut(0, ^{);
for I:= 0 to N-1 do
[Text(0, S(I));
if I<N-2 then Text(0, ", ");
if I=N-2 then Text(0, " and ");
];
ChOut(0, ^});
];
int I;
for I:= 0 to 4 do
if I#3 then [Quibble(I, ["ABC", "DEF", "G", "H"]); CrLf(0)]