Var a,b: array[1..6] of integer; i,c: integer; begin for i:=1 to 6 do a[i]:=random(100); writeln(a); b:=a; c:=a[6]; for i:=1 to 5 do a[i+1]:=b[i]; a[1]:=c; writeln(a); end.
Procedure Vvod(Var Q:mas; p:integer); var i:integer; begin for i:=1 to p do read(Q[i]); end;
program obrab(N:mas; w:integer; var max:real;); var i:integer; begin max:=1; for i:=1 to w do begin if N[i]>0 then max:=max*N[i]; end; end; program sravnenie(U:mas; O:mas; m.r:integer; maxA,maxB:real); var i,j:integer
begin if maxA>maxB then begin for i:=1 to m do write(U[i]); end else begin for i:=1 to r do write(O[i]); end; end;
begin writeln('vvedite kol-vo elementov mas1'); readln(n); Vvod(A,n); writeln('vvedite kol-vo elementov mas2'); readln(l); Vvod(B,l); obrab(A,n,max1); obrab(B,l,max2); sravnenie(A,B,n,l,max1,max2); end.
function ProdPos(a: V): longint; var i: integer; begin Result := 1; foreach var p: longint in a do if p > 0 then Result := Result * p end;
procedure InitMas(var a: V; title: string); var i: integer; begin writeln(title, '(', length(a, 0), '). Вводите элементы.'); for i := 0 to length(a, 0) - 1 do read(a[i]) end;
for i:=1 to 6 do a[i]:=random(100); writeln(a); b:=a;
c:=a[6];
for i:=1 to 5 do a[i+1]:=b[i]; a[1]:=c; writeln(a);
end.
ч/з второй массив