cpp implementation of Palindrome Number