import java.io.IOException;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) throws IOException {
        Scanner scan = new Scanner(System.in);
        String[] arr = scan.nextLine().split(" ");
        int size = arr.length;
        int[] intArr = new int[size];

        for(int i=0; i<arr.length; i++){
            int a = Integer.parseInt(arr[i]);
            
            if(a%2 == 0){
                System.out.println(a);
            }
        }
    }
}

복사했습니다!