Pagini recente » Cod sursa (job #1546558) | Cod sursa (job #3274008) | Cod sursa (job #1394005) | Cod sursa (job #1823448) | Cod sursa (job #221789)
Cod sursa(job #221789)
program scm;
var ok:array[1..150] of byte;
v:array[1..10001] of longint;
n,i,st,stp,max,pl,op:longint;
f,g:text;
begin
assign(f,'scmax.in');
assign(g,'scmax.out');
reset(f);
rewrite(g);
read(f,n);readln(f);read(f,v[1]);st:=1;stp:=0;max:=0;
for i:=2 to n do
begin
read(f,v[i]);
if v[i]>v[i-1] then
stp:=i else begin st:=i; if stp-st+1>max then begin max:=stp-st+1; pl:=st;op:=stp; end; end;
end;
if stp-st+1>max then begin max:=stp-st+1; pl:=st;op:=stp; end;
write(g,max);writeln(g);
for i:=pl to op-1 do write(g,v[i],' ');
write(g,v[op]);
closE(f);
close(g);
end.