Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public bool IsPalindrome(int x) {
- if(x < 0) return false;
- var t = x;
- var n = 0;
- while(x > 0 )
- {
- var mod = x % 10;
- x = x / 10;
- n = n * 10 + mod;
- }
- return t == n;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement