Uses crt;
var i,j,k,ni,nj:integer; a:array[1..100,1..100] of integer;
begin
clrscr;
randomize;
ni:=3; nj:=8;
for i:=1 to nj do begin
for j:=1 to ni do
a[i,j]:=random(10);
end;
for i:=1 to nj do begin
for j:=1 to ni do
write(a[i,j],' ' ); writeln;
end;
for i:=1 to nj do begin
for j:=1 to ni do
k:=k+a[i,j];
end;
writeln('sr = ',k);
readln
end.