Created
June 18, 2013 01:59
-
-
Save alex-lx/5802091 to your computer and use it in GitHub Desktop.
reverce a integer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int reverce_number(int v) { | |
int rv = 0, remainder; | |
for (; v != 0; remainder = v % 10, v /= 10, rv = rv * 10 + remainder) /* nothing */; | |
return rv; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment