Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fun :: Integer -> [Integer]
- fun x = x:(fun.unirnumeros)[ fromIntegral((length y)*10) + head y| y<-(group.numeroalista) x]
- numeroalista 0 = []
- numeroalista x = numeroalista (div x 10) ++ [mod x 10]
- unirnumeros:: [Integer]->Integer
- unirnumeros x = (modbase.concat) [(cam.numeroalista) n|n<-x]
- where
- modbase (x:[]) = x
- modbase (x:y) = x * (fromIntegral(10^(length y))) + (unirnumeros y)
- cam [] = [0]
- cam x = x
Advertisement
Add Comment
Please, Sign In to add comment