Код Pascal:
Const
N = 3;
M = 4;
Var
A:array[1..N,1..M] of shortint;
B:array[1..N] of byte;
i,j,k:byte;
Begin
Randomize;
For i:= 1 to N do
Begin
k:=0;
For j:= 1 to M do
Begin
A[i,j]:=random(21)-10;
Write(A[i,j]:3,' ');
if A[i,j] > 0 then k:=k+1;
End;
B[i]:=k;
WriteLn;
End;
WriteLn;
For i:= 1 to N do
Write(B[i],' ')
End.