- Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathSolution9.java
More file actions
Latest commit
executable file
·29 lines (26 loc) · 684 Bytes
/
Copy pathSolution9.java
File metadata and controls
executable file
·29 lines (26 loc) · 684 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
importjava.util.Arrays;
/**
* Created by slade on 2019/5/30.
*/
publicclassSolution9 {
booleanisPalindrome(intx) {
booleantag;
Strings = String.valueOf(x);
intlength = s.length();
Stringreverse_s = "";
for (inti = length - 1; i >= 0; i--) {
reverse_s = reverse_s + s.charAt(i);
}
// System.out.println(reverse_s);
if (s.equals(reverse_s)) {
tag = true;
} else {
tag = false;
}
returntag;
}
publicstaticvoidmain(String[] args) {
// solution9 s = new solution9();
// System.out.println(s.isPalindrome(92318));
}
}