thử code anh mới tìm dc nhé
begin
for i:=1 to n do
if a<a[i+1] then b:=1
else b=0;
for i:=1 to n do
begin
kt:=1;
for j:=i to n do
if (kt=1) and (b[j]=1) then c:=c+1
else kt:=0;
end;
max:=c[1];
for i:=1 to n do
if max<c then
begin
max:=c;
cs:=i;
end;
writeln('day con dai nhat là')
for i:=cs to cs+max do write(a:5);
end.
thử code anh mới tìm dc nhé
begin
for i:=1 to n do
if a<a[i+1] then b:=1
else b=0;
for i:=1 to n do
begin
kt:=1;
for j:=i to n do
if (kt=1) and (b[j]=1) then c:=c+1
else kt:=0;
end;
max:=c[1];
for i:=1 to n do
if max<c then
begin
max:=c;
cs:=i;
end;
writeln('day con dai nhat là')
for i:=cs to cs+max do write(a:5