fork download
  1. import java.util.Scanner;
  2.  
  3. public class Main {
  4. public static void main(String[] args) {
  5. Scanner sc = new Scanner(System.in);
  6. if (!sc.hasNextLine()) return;
  7. String s = sc.nextLine();
  8.  
  9. boolean L1 = false;
  10. boolean f = false;
  11.  
  12. String[] words = s.trim().split("\\s+");
  13.  
  14. for (String w : words) {
  15. if (w.length() >= 2) {
  16. char[] c = w.toCharArray();
  17. if (c[0] == c[1]) {
  18. System.out.println(w);
  19. f = true;
  20. }
  21. }
  22. }
  23.  
  24. if (!f) {
  25. L1 = true;
  26. System.out.println("L1 = " + L1);
  27. }
  28. }
  29. }
  30.  
Success #stdin #stdout 0.16s 58952KB
stdin
незрівнянна туманна тиша огорнула сонну долину
stdout
L1 = true