# 数组元素统计

<p>定义一个长度为5的数组arr1&#xff0c;用于存放5个1~9的随机整数&#xff08;范围包含1和9&#xff09;&#xff0c;再定义一个长度为2的数组arr2&#xff0c;统计arr1中的元素对2求余等于0的个数,保存到arr2[0], 统计arr1中的元素对3求余等于0的个数,保存到arr2[1],在控制台打印输出arr2的所有元素</p>

## template

```java
package com.auskat.demo.cc;
import java.util.Random;
public class RandomTest {
	public static void main(String[] args) {
		int arr1[] = new int[5];
		for (int i = 0; i < arr1.length; i++) {
			arr1[i] = new Random().nextInt(9) + 1;
		}
		int i2 = 0;
		int j3 = 0;
		for (int i = 0; i < arr1.length; i++) {
			if (arr1[i] % 2 == 0) {
				i2++;
			}
			if (arr1[i] % 3 == 0) {
				j3++;
			}
		}
		int arr2[] = new int[2];
		arr2[0] = i2;
		arr2[1] = j3;
		for (int i = 0; i < arr2.length; i++) {
			System.out.println(arr2[i]);
		}
	}
}
```

## 答案

```java

```

## 选项

### A

```java

```

### B

```java

```

### C

```java

```