A decal is an integer where all digit pairs either side of its center add up to 10. For example, 159 is a decal, as 1 + 9 = 10 and 5 + 5 = 10.
The first 11 decals are 5, 19, 28, 37, 46, 55, 64, 73, 82, 91 and 159.
Write a program that, given an integer n (where 0 < n < 2^31), outputs the nth decal.
Your program must be written in Java, C or C++ and terminate within 5 seconds. It should read a single integer from the command line, and output the result on the next line.
Example:
100
9911
_____________
Jenny
Edited by jeckvishva, 01 July 2012 - 09:54 AM.