Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Eleva un numero a un exponente utilizando recursion
- potencia base 0 = 1
- potencia base exp = base * potencia base (exp-1)
- -- Cuenta los digitos de un numero
- cuentaDigitos 0 = 1
- cuentaDigitos x = 1 + if x `div` 10 /= 0 then
- cuentaDigitos (x `div` 10)
- else
- 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement