Looks like I'd fail your pre-screen test. What's the "mathematical" solution if you're not allowed to convert strings to ints? Ascii math?
ones = number % 10
tens = number // 10
do_print = (ones + tens) == 10OP mentioned reading from a file, which you would only be able to use after string conversion to ints.
if toInt(number) % 10 != 0
print number
else print number + "(" + number[0] + "," + number[1] + ")"However for any multiple of 9, the digits will add up to a multiple of 9. So you're looking for numbers in [ (n+2)*9 + 1 for n in range(9) ]
The common string based solution was to use a for loop, convert the counter to a string, parse the digits converting each one to a an integer and performing the calculation.
The exercise was given in C# so candidates just use string interpolation to output the result