wrong answer in compilers and parsers......

why this code gives wrong answer…can anyone plz provide testcases for which this code is wrong…
thanks in advance…
link http://www.codechef.com/viewsolution/5489437