Язык Паскаль АБС нэт
var
a:array[1..100] of integer;
b:array[1..50] of integer;
i,c,s,n:integer;
begin
read(n);
for i:=1 to n do a[i]:=random(3); write(a[i]:3);
i:=0;
while i i+=1;
if a[i] =0 then s+=1;
if (a[i] <> 0 and s > 0) or (i=n) then begin
c+=1;
b[c]:=s;
s:=0;
end;
end;
for i:=1 to n do begin
write(b[i]:3);
end;
end.