개요[ | ]
- HR자바 Java String Reverse
Java
Copy
import java.io.*;
import java.util.*;
public class Solution {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
String A=sc.next();
/* Enter your code here. Print output to STDOUT. */
if( new StringBuffer(A).reverse().toString().equals(A) ) {
System.out.println("Yes");
}
else {
System.out.println("No");
}
}
}
Java
Copy
import java.io.*;
import java.util.*;
public class Solution {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
String A=sc.next();
/* Enter your code here. Print output to STDOUT. */
if( A.equals(new StringBuilder(A).reverse().toString()) ) {
System.out.println("Yes");
}
else {
System.out.println("No");
}
}
}
편집자 Jmnote Jmnote bot
로그인하시면 댓글을 쓸 수 있습니다.