https://www.codechef.com/viewsolution/15982506 I followed a different approach than others.
There should be not leading zeros in the result. Your solution would fail for:
1 555 500
either convert the result to int
remove the leading 0s.
remove leading zeros ‘0’ or if all value is zero the print only one zero ‘0’ if got the same problem
my code link https://www.codechef.com/viewsolution/15987621