progs/fact.scala
changeset 446 30b8f14b2655
equal deleted inserted replaced
445:160cbb09027f 446:30b8f14b2655
       
     1 object Fact {
       
     2 
       
     3 def fact(n: Int): Int = 
       
     4   if (n == 0) 1 else n * fact(n - 1)
       
     5 
       
     6 }