def f(n):r=10**len(`n`)/9;print-n/r*-r-n for n in 8, 100, 113, 87654321, 42, 20000, 11132: f(n)
Standard input is empty
0 11 109 1234567 2 2222 11090
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!