copyEvens】的更多相关文章

public int[] copyEvens(int[] nums, int count) { int newIndex=0; int i=0; int newArray[] = new int[count]; while(newIndex < count ){ if( ( nums[i] % 2) ==0 ) newArray[newIndex++]=nums[i]; i++; } return newArray; } http://codingbat.com/prob/p134174…