Program fantscrin;
const n = 10;
Var a: array [1..n] of integer;
b: array [1..n] of integer;
i,j:integer;
Begin
j:=0;
for i:=1 to n do
a[i]:=random(20);
write(a[i], ' ');
if (i mod 2 <> 0) then
begin
j:=j+1;
b[j]:=a[i];
end;
writeln('');
a[i]:=0;
for i:=1 to j do
a[i]:=b[i];
writeln(j);
End.
Program Massive;
uses Crt;
const
K = 3;
L = 6;
var
Z: array [1..K * L] of integer;
R: array [1..K * L] of integer;
Q: array [1..K * L] of integer;
i: integer;
x: integer;
Randomize;
x := K * L;
for i:= 1 to x do
Z[i] := Random(20);
R[i] := Random(10);
ClrScr;
writeln('Massive Z:');
write(Z[i]:4);
writeln;
writeln('Massive R:');
write(R[i]:4);
Q[i]:= Z[i] * R[i] + 10;
writeln('Massive Q:');
write (Q[i]:4);
readln
end.
Program fantscrin;
const n = 10;
Var a: array [1..n] of integer;
b: array [1..n] of integer;
i,j:integer;
Begin
j:=0;
for i:=1 to n do
a[i]:=random(20);
for i:=1 to n do
write(a[i], ' ');
for i:=1 to n do
if (i mod 2 <> 0) then
begin
j:=j+1;
b[j]:=a[i];
end;
writeln('');
for i:=1 to n do
a[i]:=0;
for i:=1 to j do
a[i]:=b[i];
for i:=1 to j do
write(a[i], ' ');
writeln('');
writeln(j);
End.
Program Massive;
uses Crt;
const
K = 3;
L = 6;
var
Z: array [1..K * L] of integer;
R: array [1..K * L] of integer;
Q: array [1..K * L] of integer;
i: integer;
x: integer;
begin
Randomize;
x := K * L;
for i:= 1 to x do
begin
Z[i] := Random(20);
R[i] := Random(10);
end;
ClrScr;
writeln('Massive Z:');
for i:= 1 to x do
write(Z[i]:4);
writeln;
writeln('Massive R:');
for i:= 1 to x do
write(R[i]:4);
writeln;
for i:= 1 to x do
Q[i]:= Z[i] * R[i] + 10;
writeln('Massive Q:');
for i:= 1 to x do
write (Q[i]:4);
readln
end.