Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def fact(x: Int) = {
- def factacc(acc:Int, x:Int):Int = if (x == 1) 1 else factacc(acc * x, x - 1)
- factacc(1, x)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement