package com.itheima.demo01;
public class Bug07 {
public static void main(String[] args) {
int[] arr = {20, 22, 23, 24, 28, 26};
int sum = getSum(arr);
System.out.println(sum);
}
public static int getSum(int[] arr) {
int sum = 0;
for (int i = 0; i < arr.length; i+=2) {
if (arr[i] % 2 == 0 ) {
sum += arr[i];
}
}
return sum;
}
}