-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBj10807.java
More file actions
47 lines (41 loc) · 1.07 KB
/
Bj10807.java
File metadata and controls
47 lines (41 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package array;
import java.util.Scanner;
public class Bj10807 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
int[] arr = new int[N];
int count = 0;
for (int i = 0; i < N; i++) {
arr[i] = sc.nextInt();
}
int v = sc.nextInt();
for (int i = 0; i < arr.length; i++) {
if (v == arr[i])
count += 1;
}
System.out.println(count);
}
// public static void main(String[] args) {
// Scanner sc = new Scanner(System.in);
//
// int N = sc.nextInt();
// ArrayList<Integer> arr = new ArrayList<Integer>();
//
// for (int i = 0; i < N; i++) {
// int arrNum = sc.nextInt();
// arr.add(arrNum);
// }
//
// int v = sc.nextInt();
// int count = 0;
//
// for (int i = 0; i < arr.toArray().length; i++) {
// if (arr.get(i) == v) {
// count++;
// }
// }
//
// System.out.println(count);
// }
}