Chewbacca and number

I don’t understand this question
whats wrong in this code:

@YashJ,
https://ide.codingblocks.com/s/169236 This is the corrected code.
You had to put long everywhere in ans,x,rem. Also in your code if the number is 81. It will give output as 81 not 11.

thank you but for a number 990 I thought output will be 9 (009) but I guess we cannot reduce number of digits.

@YashJ,
The answer for 990 will be 900. Please mark the doubt as resolved if you are satisfied with the answer