Program long;
uses Crt;
const n=5;
type Vec=array [1..n] of integer;
var A, B, C: Vec;
i,j,k, Col: integer;
Pro: longint;
a1, a2: integer;
begin
ClrScr;
Randomize;
Col:=1; Pro:=1;
WriteLn ('Massiv A:');
for i:=1 to n do
begin
A[i]:=500+random(2000);
Write(A[i]:6);
if A[i] >1000 then
begin
B[Col]:=A[i]; Col:=Col+1;
end;
end; WriteLn;
Col:=Col-1; WriteLn;
WriteLn ('Massiv B:');
for i:=1 to Col do
WriteLn(B[i]);
WriteLn;
k:=1;
for i:=1 to n do
begin
a2:=B[i] mod 10;
a1:=B[i] div 1000;
if sqr(a1) begin
C[k]:=B[i];
k:=k+1;
end;
end;
for i:=1 to k-1 do
Pro:=Pro*C[i];
WriteLn ('Pro=',Pro);
ReadLn;
end.