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
hide comments
moody7alim:
2018-03-03 01:03:29
always use SPOJ toolkit before submitting a solution |
|
Noor Bakeer:
2015-09-15 07:12:58
@momenahmedsaid Try to use long long data type |
|
marco christian sutanto:
2014-12-19 14:33:23
make a limit please |
|
mohammed2049 :
2014-08-12 11:55:29
terminates EOF mean while(cin >> x) |
|
momenahmedsaid:
2014-08-12 04:40:33
what is "terminates at EOF"??
|
|
momenahmedsaid:
2014-08-12 04:31:45
it gives me wrong answer although i made it by recursion and the test cases are true!!!!! |
Added by: | Mohamed Ali |
Date: | 2013-04-27 |
Time limit: | 1s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All |