Program zadacha;vara: array[1..5] of byte;i,max: byte;beginmax:=0;for i:=1 to 5 do begin a[i]:=random(255); write(a[i]:4);end;writeln; for i:=1 to 5 doif a[i]>max then max:=a[i]; writeln('max=',max); end.
Const n = 30; var a : array [1 .. n] of integer; i, k1, k2 : integer;
begin for i := 1 to n do read(a[i]); k1:=0; k2:=0; for i:=1 to n do if (a[i]>0) then begin if k1>k2 then k2:=k1; k1:=0; end else k1:=k1+1; if k1>k2 then k2:=k1; writeln('max = ',k2); end.