Var a:array[1..20] of integer;
i, k:integer;
fout:text;
begin
for i:=1 to 20 do
a[i]:=20 - random(41);
assign(fout, 'out.txt');
rewrite(fout);
for i:=1 to 20 do
if a[i] mod 2 = 0 then
k:=k+1;
if k <> 0 then
for i:=1 to 20 do begin
if a[i] mod 2 = 0 then
write(fout, a[i], ',');
end
else write(fout, 'Четных элементов массиве нет.');
close(fout);
end.