progs/factT.scala
changeset 449 d67c5f7177a6
equal deleted inserted replaced
448:db2a3e3287a9 449:d67c5f7177a6
       
     1 object FactT {
       
     2 
       
     3 def factT(n: Int, acc: Int): Int =
       
     4   if (n == 0) acc else factT(n - 1, n * acc)
       
     5 
       
     6 }