The Next Palindrome: C version

http://www.codechef.com/problems/PALIN

PASSED
The Next Palindrome: input

Correct output:
818
2222