\ Triangle de Pascal \
Package TriangleDePascal

Uses IO

Var
   NbLignes As Int

Def Combinaison(N,P As Int) As Int
Var
   I As Int
   C As Int
Enter
 C=1
 For I=0 to P-1 do
  C=(C*(N-P+1+I))/(I+1)
 Next
 Result=C
Leave

Sub LTriangle(NoLigne As Int)
Var
   I As Int
Enter
 For I=0 to NoLigne do
  PrintX Combinaison(NoLigne,I)
  PrintS "  "
 Next
Leave

Sub Triangle(NbLignes As Int)
Var
   I As Int
Enter
 For I=1 to NbLignes do
 Begin
  LTriangle(I)
  PrintCR
 Next
Leave

Sub FlushBuf
Enter
\Mem[0:1050]=Mem[0:1052]\
Leave

Enter
 NbLignes=10
 Triangle(NbLignes)
Leave