можно ли выводить (печатать) множества. КАК?
почему нельзя написать Write(set1); ?
var
s: Set of byte;
i: Byte;
begin
...
s := [3, 1, 12];
for i := 0 to 255 do
if i in s then writeln(i);
...
end.
var s: set of byte;
i:byte;
begin
s:=[1,2,6,9];
for i:=1 to 255 do if i in s then write (i);
end.
М | И ноль потерял Цитата for i:=1 to |
type days=(Sun, Mon, Tue, Wed, Thu, Fri, Sat);
const ndays:array [days] of string=
('Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat');
var s:set of days;
dd:days;
begin
s:=[Sun, Mon, Wed, Thu, Fri, Sat];
for dd:=sun to sat do
if dd in s then write (ndays[dd],' ');
end.
type days=(Sun, Mon, Tue, Wed, Thu, Fri, Sat);
const ndays:array [days] of string=
('Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat');
var s:set of days;
dd:days;
begin
s:=[Sun, Mon, Wed, Thu, Fri, Sat];
for dd:=sun to sat do
if dd in s then write (ndays[dd],' ');
end.