Advertisement
deyanmalinov

04. Word Filter

Mar 18th, 2019
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.58 KB | None | 0 0
  1. package DPM;
  2.  
  3. import java.util.*;
  4.  
  5. public class Main {
  6.         public static void main(String[] args) {
  7.             Scanner scan = new Scanner(System.in);
  8.             String [] line = scan.nextLine().split(" ");
  9.             Arrays.asList(line).stream().filter(w -> w.length() % 2 == 0)
  10.                     .forEach(System.out::println);
  11. /////////////////////////////////////
  12. Arrays.stream(scan.nextLine().split(" ")).
  13.                     filter(w -> w.length() % 2 == 0).
  14.                     forEach(e -> System.out.println(e));
  15. ////////////////////////////////////
  16.         }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement