Alphacode SPOJ problem

i am getting correct output for sample questions but not passing all the test cases

Here is my code.

Okay , I have modified your code .
Check this
https://ide.codingblocks.com/#/s/24042