Skip to content

Commit 5c44fa0

Browse files
authored
Update 11_StringReverse.java
1 parent cbba945 commit 5c44fa0

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -1 +1,31 @@
1+
import java.io.*;
2+
import java.util.*;
3+
4+
public class Solution {
5+
6+
public static void main(String[] args) {
7+
8+
Scanner sc=new Scanner(System.in);
9+
String A=sc.next();
10+
char a[] = A.toCharArray();
11+
/* Enter your code here. Print output to STDOUT. */
12+
String result ="Yes";
13+
int length = A.length();
14+
for (int i=0; i<length/2;i++)
15+
{
16+
if(A.substring(i,i+1).equals(A.substring(length-i-1,length-i)))
17+
{
18+
}
19+
else
20+
{
21+
result ="No";
22+
}
23+
}
24+
System.out.println(result);
25+
26+
}
27+
}
28+
29+
30+
131

0 commit comments

Comments
 (0)