Uses crt; var x,m: array [1..40] of integer; n,k,c:integer; begin readln(n); c:=1; for k:=1 to n do begin write('x[',k,']:'); readln(x[k]); end; k:=1; repeat if x[k]>0 then begin m[c]:=x[k]; inc(c); inc(k); end else inc(k); until c=6; writeln; for c:=1 to 5 do writeln('m[',c,']:',m[c]); end.
var x,m: array [1..40] of integer;
n,k,c:integer;
begin
readln(n);
c:=1;
for k:=1 to n do
begin
write('x[',k,']:');
readln(x[k]);
end;
k:=1;
repeat
if x[k]>0 then
begin
m[c]:=x[k];
inc(c);
inc(k);
end
else inc(k);
until c=6;
writeln;
for c:=1 to 5 do
writeln('m[',c,']:',m[c]);
end.