import java.util.Scanner;
public class BJ1 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
int[] array = new int[n];
int num = 0;
for(int i = 0; i < n; i++) {
array[i] = sc.nextInt();
}
int v= sc.nextInt();
for(int i = 0; i < array.length; i++) {
if (v == array[i]){
num++;
}
}
System.out.println(num);
}
}
입력 받을 땐 BufferedReader를 사용해야 하는데 익숙하지가 않다...
그래도 출력 시간에 유의미한 차이가 보이니 조금씩 써보자
벨로그도 괜찮지만 티스토리는 배경을 내 맘대로 할 수 있어서 역시 좋다....
'문제 풀이 > 자바' 카테고리의 다른 글
자바 문제 풀이 5 (0) | 2023.04.13 |
---|---|
자바 문제 풀이 4 (0) | 2023.04.11 |
자바 문제 풀이 3 (0) | 2023.04.09 |
자바 문제 풀이 (0) | 2023.04.05 |
230209~230223(코드워즈) (0) | 2023.02.09 |