Var c:integer;
procedure generate(var c:integer);
var ar:array[1..3,1..4] of integer;
a,b:integer;
begin;
for a:=1 to 3 do
begin;
writeln;
for b:=1 to 4 do
begin;
ar[a,b]:=random(10);
c+=ar[a,b];
write(ar[a,b]:4);
end;
end;
end;
begin;
randomize;
writeln('Matrix:');
generate(c);
writeln;
writeln('Result',c);
end.