Помогите сделать подпрограмму с помощью процедуры!!! пожалуйста!!!
const
CSize1=7;
CSize2=6;
CSize3=5;
type
TMas1=array[1..CSize1,1..CSize1] of integer;
TMas2=array[1..Csize2, 1..CSize2] of integer;
TMas3=array[1..Csize3, 1..CSize3] of integer;
var
A1:TMas1;
A2:TMas2;
A3:TMas3;
i,j,x, y:byte;
function zero(i:integer):boolean;
begin
zero:=false;
if i=0 then zero:=true;
end;
function interval(i:integer):boolean;
begin
interval:=false;if (i<=12) and (i>=1) then interval:=true;
end;
begin
X:=0;
Y:=0;
randomize;
for i:=1 to CSize1 do
begin for j:=1 to CSize1 do
begin A1[i, j]:=random(50);
write(A1[i, j]:3);
if zero(A1[i, j]) then inc(x);
if interval(A1[i,j]) then inc(y);
end;
writeln;
end;
writeln('Kol-vo 0 =', x);
writeln('Kol-vo v intervale=', y);
writeln;
x:=0;
y:=0;
for i:=1 to CSize2 do
begin for j:=1 to CSize2 do
begin A2[i, j]:=random(50);
write(A2[i,j]:3);
if zero(A1[i,j]) then inc(x);
if interval(A2[i,j]) then inc(y);
end;
writeln;
end;
writeln('Kol-vo 0 =', x);
writeln('Kol-vo v intervale=', y);
writeln;
x:=0;
y:=0;
for i:=1 to CSize3 do
begin for j:=1 to CSize3 do
begin A3[i, j]:=random(50);
write(A3[i,j]:3);
if zero(A3[i,j]) then inc(x);
if interval(A3[i,j]) then inc(y);
end;
writeln;
end;
writeln('Kol-vo 0 =', x);
writeln('Kol-vo v intervale=', y);
writeln;
x:=0;
y:=0;
end.