4SI "lycée el battan"

program missimpo;
uses wincrt;
type
mat= array[-20..20,1..20] of integer;
var
l,k,f, x,i,j,n:integer;
m:mat;
procedure saisie (var n:integer);
begin
write ('donner le nombre de case de mateice : ');
readln (n);
end;
procedure remplir (var m:mat ; n :integer);
begin for i:=-n to n do
begin
m[i,1]:=1;
end;
begin
for k:=1 to n do
m[k,(k+1)+1]:=1;
end;
for f:=-n to -1 do
begin
m[f,(n-(f+n))]:=1;
end;
for l:=1 to n do begin
for j:=2 to n do begin
m[l,j]:= m[l-1,j]+ m[l-1,j-1]; end; end;
for i:=-1downto -n do
for j:=2 to n do
m[i,j]:=m[-i,j]+m[-i,-j]; end;
procedure affiche( m:mat ; n :integer);
begin
writeln; writeln; writeln; for i:=-n+1 to 0 do
begin
for j:=1 to 1+n-(i+n) do
begin
write(m[i,j]:4);
end;
writeln;
end; for i:=1 to n-1 do
begin
for j:=1 to i+1 do
begin
write(m[i,j]:4);
end;
writeln;
end; end;
begin
saisie(n);
remplir(m,n);
affiche(m,n);
end.