public class PoljeElementov2 { static int[] poisciSoda(int st[]){ int stevec = 0; int pomoznoPolje[]; for(int i = 0; i < st.length; i++){ if(st[i] % 2 == 0){ stevec++; } } pomoznoPolje = new int[stevec]; int novStevec = 0; for(int i = 0; i < st.length; i++){ if(st[i] % 2 == 0){ pomoznoPolje[novStevec] = st[i]; novStevec++; } } return(pomoznoPolje); } public static void main(String a[]){ int stevila[] = {1, 5, 88, 16, 17, 1920, 827, 827, 33, 222, 313, 111}; int rezultat[]; rezultat = poisciSoda(stevila); for(int i = 0; i < rezultat.length; i++) { System.out.println(rezultat[i]); } } }