public class Main {
public static void main(String[] args) {
// TODO Auto-generated method stub
int[] ints = {2,3,5,9,8,1};//初始化数组
int Osums = 0;//偶数个数
int Jsums = 0;//奇数个数
for(int i = 0; i < ints.length;i++){//循环数组
if(ints[i]%2==0){//取
余数 Osums++;
}else{
Jsums++;
}
}
System.out.println("偶数个数:"+Osums);
System.out.println("奇数个数:"+Jsums);
}
}