Pascal
var
a:array of integer;
i, n, m, l:integer;
begin
writeln('введите n, m, l:');
readln(n, m, l);
setlength(a, n);
randomize;
for i:=0 to n-1 do begin
a[i]:=random(41)-20;
if a[i] mod m = l then
writeln(a[i]);
end;
writeln(a);
end.
Pascal
var
a:array of integer;
i, n, m, l:integer;
begin
writeln('введите n, m, l:');
readln(n, m, l);
setlength(a, n);
randomize;
for i:=0 to n-1 do begin
a[i]:=random(41)-20;
if a[i] mod m = l then
writeln(a[i]);
end;
writeln(a);
end.