I recently here about SPOJ 'Sphere Online Judge' So i signed up and answered the first question and the question was
Question
A positive integer is called a palindrome if its representation in the decimal system is the same when read from left to right and from right to left. For a given positive integer K of not more than 1000000 digits, write the value of the smallest palindrome larger than K to output. Numbers are always displayed without leading zeros.
Input
The first line contains integer t, the number of test cases. Integers K are given in the next t lines.
Output
For each K, output the smallest palindrome larger than K.
Example
Input:
2
808
2133
Output:
818
2222
So i coded the program as best i can and the program is
Try your program for k=122 (gives a smaller answer) and k=1 (gives an answer not larger than k).
Also, that fflush(stdin); in there might be causing you grief. That's non-standard stuff and--even if it works--will kill any script the judges are using to test your program. Get rid of it and add a dummy gets(c) between lines 15 and 16.
(I hope you are aware that using gets() is a no-no also, but it shouldn't be an issue here.)
I don't understand what you want to say by first line but for the second line if i remove fflush(stdin) than it will run only for t-1 cases and after doing all that i get wrong answer on SPOJ.