Const
n=10;
var
a:array[1..n] of integer;
i,_start,_end, startInd, endInd:integer;
begin
Randomize;
Write('Исходный массив: ');
_start:=-1; _end:=-1;
startInd:=-1; endInd:=-1;
for i:=1 to n do
begin
a[i]:=random (0,100);
Write(a[i],' ');
end;
Writeln;
for i:=2 to n do
begin
if a[i]>a[i-1] then
if _start > -1 then _end := i else
begin
_start := i-1;
_end := i;
end
else
begin
if (_start > -1) and ((endInd - startInd) < (_end - _start)) then
begin
startInd := _start;
endInd := _end;
end;
_start := -1;
_end := -1;
end;
end;
if startInd > -1 then
begin
Writeln('Длина диапазона: ', (endInd-startInd+1));
Write('Значения из диапазона: ');
for i:=startInd to endInd do Write(a[i],' ');
end;
end.