We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent efa381e commit 6b0871dCopy full SHA for 6b0871d
Leet_Code/Random Problem/9-PalindromeNumber.cpp
@@ -0,0 +1,10 @@
1
+class Solution {
2
+public:
3
+ bool isPalindrome(int x) {
4
+
5
+ int y(x);
6
+ int test(0);
7
+ while(y > 0){test = 10 * test + (y % 10); y /= 10;}
8
+ return (test == x);
9
+ }
10
+};
0 commit comments