program arrdiap;
var
N, A, B, i: Integer;
M: array of Integer;
begin
Write ('Введите размерность массива: ');
ReadLn (N);
SetLength (M, N);
Randomize;
for i := Low (M) to High (M) do begin
M [i] := Random (100);
Write (M [i], ' ');
end;
WriteLn;
Write ('Введите диапазон A, B: ');
ReadLn (A, B);
WriteLn ('Принадлежит диапазону ', A, ' - ', B, ':');
if (M [i] >= A) and (M [i] <= B) then
ReadLn;
end.
program arrdiap;
var
N, A, B, i: Integer;
M: array of Integer;
begin
Write ('Введите размерность массива: ');
ReadLn (N);
SetLength (M, N);
Randomize;
for i := Low (M) to High (M) do begin
M [i] := Random (100);
Write (M [i], ' ');
end;
WriteLn;
Write ('Введите диапазон A, B: ');
ReadLn (A, B);
WriteLn;
WriteLn ('Принадлежит диапазону ', A, ' - ', B, ':');
for i := Low (M) to High (M) do begin
if (M [i] >= A) and (M [i] <= B) then
Write (M [i], ' ');
end;
ReadLn;
end.