Playground/자바문제집

[백준] 10807번

미숫가루설탕많이 2023. 1. 20. 20:00
import java.util.Scanner;

public class Main {
   public static void main(String[] args) {
      Scanner sc = new Scanner(System.in);

      int N = sc.nextInt();
      int[] arr = new int[N];
      int cnt = 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 (arr[i] == v)
            cnt++;
      }
      System.out.println(cnt);
   }
}

'Playground > 자바문제집' 카테고리의 다른 글

[백준] 10818번  (0) 2023.01.20
[백준] 10871번  (0) 2023.01.20
[백준] 1152번  (0) 2023.01.20
[백준] 10951번  (0) 2023.01.20
[백준] 1110번  (0) 2023.01.19