const
n=5;
m=10;
var
a:array [1..n,1..m] of integer;
i,j,sum,count: integer;
begin
count:=0; sum:=0;
for i:=1 to n do
for j:=1 to m do
a[i,j]:=random(41)-20;
write(a[i,j]:4);
if a[i,j]>0 then
inc(count);
sum:=sum+a[i,j];
end;
writeln;
write(sum/count:4:4);
end.
const
n=5;
m=10;
var
a:array [1..n,1..m] of integer;
i,j,sum,count: integer;
begin
count:=0; sum:=0;
for i:=1 to n do
begin
for j:=1 to m do
begin
a[i,j]:=random(41)-20;
write(a[i,j]:4);
if a[i,j]>0 then
begin
inc(count);
sum:=sum+a[i,j];
end;
end;
writeln;
end;
writeln;
write(sum/count:4:4);
end.