package HomeWork;
import java.util.Scanner;
public class Test21 {
public static void main(String[] args) {
// TODO Auto-generated method stub
/*
* 编写程序,统计 4*5 二维数组中奇数的个数和偶数的个数
*/
Scanner in = new Scanner(System.in);
int a[] [] = new int[4][5];
int oushu = 0;
int jishu = 0;
System.out.print("请输入二维数组:");
for(int i = 0;i<4;i++){
for(int j = 0;j<5;j++){
a[i][j] = in.nextInt();
}
}
for(int i = 0;i<4;i++){
for(int j = 0;j<5;j++){
if(a[i][j]%2==0){
oushu++;
}else{
jishu++;
}
}
}
System.out.println("二维数组中奇数个数为:"+jishu+"偶数个数为:"+oushu);
}
}