Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Arrays;
- import java.util.Scanner;
- public class Main {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- String input = scanner.nextLine();
- int[] allNumbers = Arrays.stream(input.split("\\s+"))
- .mapToInt(Integer::parseInt)
- .toArray();
- for(int num : allNumbers) {
- if(num % 2 == 0) System.out.print(num + " ");
- }
- System.out.println();
- scanner.close();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement