SPOJ Digit Sum getting wrong ans

Problem - SPOJ.com - Problem PR003004

My solution - 8lmVno - Online C++0x Compiler & Debugging Tool - Ideone.com

Why i am getting wrong answer on submitting when it outputs correct answer for sample case?
Any help? Thank you in advance :slight_smile:

a and b can be as big as 1e15 and you are using int to store them.

2 Likes

Again silly mistake. Thank you for pointing it out.
I was scratching head since an hour trying different inputs and checking answer.

I know my post doesn’t help you at all, but I have to say this…
SPOJ sucks

I disagree. They actually have a good collection of classical problems.
It’s worth solving them.

The problems are really great, I’m saying that the platform sucks.

How ? \hspace{0mm}