Für Vorlesungen, bitte die Webseite verwenden. https://flavigny.de/lecture
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
267B

  1. #include "fcpp.hh"
  2. int fakIter (int produkt, int zaehler, int ende)
  3. {
  4. return cond( zaehler>ende,
  5. produkt,
  6. fakIter(produkt*zaehler,zaehler+1,ende) );
  7. }
  8. int fakultaet (int n)
  9. {
  10. return fakIter(1,1,n);
  11. }
  12. int main ()
  13. {
  14. return print(fakultaet(5));
  15. }