RREVERSE - Reverse

Write a recursive function to get the reverse of a given integer. Your function MUST return an integer.

Input

For each line you will given an integer n, 0 <= n <= 2^31, terminates at EOF.

Output

For each line in input, output the reverse of n.

Example

Input:
123405
3210
1
123456789 Output:
504321
123
1
987654321

Added by:Mohamed Ali
Date:2013-04-27
Time limit:1s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All

hide comments
2018-03-03 01:03:29
always use SPOJ toolkit before submitting a solution
2015-09-15 07:12:58 Noor Bakeer
@momenahmedsaid Try to use long long data type
2014-12-19 14:33:23 marco christian sutanto
make a limit please
2014-08-12 11:55:29 mohammed2049
terminates EOF mean while(cin >> x)
2014-08-12 04:40:33 momenahmedsaid
what is "terminates at EOF"??
2014-08-12 04:31:45 momenahmedsaid
it gives me wrong answer although i made it by recursion and the test cases are true!!!!!
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.