Rekursion (Fakultät)


%!
/Factorial
{ dup 1 gt
  { dup 1 sub Factorial mul } if
} def

/PrintFact
{ dup
  5 string cvs show
  (! = ) show
  Factorial
  150 string cvs show
} def

%%Page: 1 1
/Times-Roman findfont
24 scalefont
setfont

100 550 moveto
(n! = n * \(n-1\)!       1! = 1) show

100 500 moveto
3 PrintFact
100 470 moveto
5 PrintFact
100 440 moveto
8 PrintFact
100 410 moveto
10 PrintFact
100 380 moveto
34 PrintFact
100 350 moveto
35 PrintFact

showpage


Download PostScript-File

© Holger Gehringer, Dezember 1998