fork(1) download
  1.  
  2. import java.util.Scanner;
  3.  
  4.  
  5. class Main {
  6.  
  7. public static void main (String[] args) throws java.lang.Exception {
  8.  
  9. Scanner scanner = new Scanner(System.in);
  10. String s = scanner.nextLine();
  11. System.out.print(isPalindrome(s) ? "Yes" : "No");
  12.  
  13. }
  14.  
  15. public static boolean isPalindrome(String text) {
  16. text = text.replaceAll(" ","");
  17. return text.equals(new StringBuilder(text)
  18. .reverse().toString());
  19. }
  20. }
Success #stdin #stdout 0.07s 321344KB
stdin
a roza upala na lapu azora
stdout
Yes