-
[java]백준 개수 세기 10807번알고리즘 문제풀이/백준(자바) 2023. 4. 3. 23:37
코드
import java.util.Scanner; public class BOJ_10807 { public static void main(String[] args) { Scanner in = new Scanner(System.in); int t=in.nextInt();//배열 수 int[] q= new int[t];//배열 int s=0; for(int i=0; i<t; i++){ q[i]=in.nextInt(); } int w= in.nextInt();//배열에서 찾으려고 하는 정수 for(int i=0; i<q.length; i++){ if(w==q[i]){ s++; } } System.out.println(s); in.close(); } }
링크
https://www.acmicpc.net/problem/10807
'알고리즘 문제풀이 > 백준(자바)' 카테고리의 다른 글
[java]백준 빠른 A+B 15552번 (0) 2023.04.05 [java]백준 A+B - 5 10952번 (0) 2023.04.04 [java]백준 고양이 10171번 (0) 2023.04.02 [java]백준 개 10172번 (0) 2023.04.01 [java]백준 알람 시계 2884번 (0) 2023.03.31