Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Main {
- static boolean Palindrom(String a)
- {
- for(int i=0,Length=a.length(),j=(a.length()-1);i<j;i++,j--)
- {
- if (a.charAt(i)!=a.charAt(j)) return false;
- }
- return true;
- }
- public static void main(String[] args) {
- Scanner in = new Scanner(System.in);
- String a=in.nextLine();
- if (Palindrom(a)) System.out.print("YES");
- else System.out.print("NO");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement