Where did I go wrong?

Question: CodeChef: Practical coding for everyone
AC solution: CodeChef: Practical coding for everyone
My solution : CodeChef: Practical coding for everyone
My logic is same but I think I have done some mistake in implementing it.

when you do x=10-sod%10, if sod|10 then x=10
so in testcase

1
19

your code will output 1910 instead of 190

ohh, ok thanks. I need to improve on these small things. Thanks once again.