~cpp module ReverseAndAdd where reverseAndAdd number = reverseAndAddSub 0 number reverseAndAddSub count number = if (show number) == (reverse (show number)) then [count, number] else reverseAndAddSub (count+1) (number + (read (reverse (show number))) )
~cpp ReverseAndAdd> reverseAndAdd 195 [4,9339] ReverseAndAdd> reverseAndAdd 265 [5,45254] ReverseAndAdd> reverseAndAdd 750 [3,6666] ReverseAndAdd>