33. Reverse a Number
Foundation1000 ms256 MBSolved by 0%
Read a non-negative integer and print it with its digits reversed.
Leading zeros in the result disappear — reversing 1200 gives 21, not 0021.
Constraints - `0 ≤ n ≤ 1000000000`
Input
A single line containing one integer n.
Output
Print one integer — the number with its digits reversed. Leading zeros in the result disappear.
Input1234
Output4321
Noteis a straightforward reversal
Input1200
Output21
Noteends in zeros, which must not appear as leading zeros in the answer
Hint 1Approach
Hint 2Approach
Hint 3Pseudocode
Hint 4Full solution