Skip to content

Instantly share code, notes, and snippets.

@ruan4261
Last active Apr 15, 2021
Embed
What would you like to do?
public int rev(int x) {
int res = 0;
while (x > 0) {
int mod = x % 10;
x /= 10;
res = res * 10 + mod;
}
return res;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment