1)
uses crt;
const size = 10;
var a:array [1..size] of integer;
i,p:longint;
begin
p:=1;
randomize;
for i:=1 to size do
begin
a[i]:=random(20);
write (a[i],' ');
if (a[i] mod 3 = 0) then p:=p*a[i];
end;
writeln;
writeln (p);
end.
2)
uses crt;
const size = 10;
var a:array [1..size] of integer;
i:integer;
s:real;
begin
s:=0;
randomize;
for i:=1 to size do
begin
a[i]:=random(4)+1;
write (a[i],' ');
s:=s+a[i];
end;
writeln;
s:=s/size;
writeln (s);
end.