Sign in $ create-account
~/problems ~/discussion ~/contests ~/submission
← ~/problems
P2006

Reverse the Number

Easy
// Description
Given a non-negative integer n, output the number formed by reversing its decimal digits. Leading zeros in the result are dropped.
// Input
A single integer n (0 <= n <= 10^18).
// Output
The reversed number.
// Hint
Reverse the string and convert it back to an integer to drop leading zeros.
// Samples
Sample Input
1200
Sample Output
21
// Problem Info
DifficultyEasy
Acceptance50%
Time Limit1000 ms
Memory Limit65536 KB
Accepted5