๐Ÿ•ธ Algorithm/๐Ÿ•ธ ๋ฐฑ์ค€ BaekJoon

[๋ฐฑ์ค€][java][10807][๊ฐœ์ˆ˜ ์„ธ๊ธฐ]

๋‰ด์ด NUEY 2023. 10. 15. 21:12
๋ฐ˜์‘ํ˜•

import java.util.Scanner;

public class FindTheCount {
	// 10807	๊ฐœ์ˆ˜ ์„ธ๊ธฐ
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt();
		int[] nArr = new int[n];
		int count = 0;
		
		for (int i=0; i<n; i++) {
			nArr[i] = sc.nextInt();
		}
		
		int v = sc.nextInt();
		sc.close();
		
		for (int a : nArr) {
			if (a == v) 
				count++;
		}
		
		System.out.print(count);
	}
}

 

 

 

 

๋ฐ˜์‘ํ˜•