mirror of
https://github.com/System-End/APCSA.git
synced 2026-04-19 16:38:24 +00:00
23 lines
691 B
Java
23 lines
691 B
Java
import java.util.Scanner;
|
|
|
|
public class runner_U6_L2_Activity_Three {
|
|
|
|
public static void main(String[] args) {
|
|
Scanner scan = new Scanner(System.in);
|
|
System.out.println("Enter a value for num:");
|
|
int num = scan.nextInt();
|
|
System.out.println("Enter array length:");
|
|
int len = scan.nextInt();
|
|
int[] vals = new int[len];
|
|
System.out.println("Enter values:");
|
|
for (int i = 0; i < len; i++) {
|
|
vals[i] = scan.nextInt();
|
|
}
|
|
System.out.println(
|
|
"Num divisible by " +
|
|
num +
|
|
": " +
|
|
U6_L2_Activity_Three.numDivisible(num, vals)
|
|
);
|
|
}
|
|
}
|