Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

21.02.07 - [BOJ] 10807. 개수 세기 #3

Closed
suhyunsim opened this issue Feb 9, 2021 · 0 comments
Closed

21.02.07 - [BOJ] 10807. 개수 세기 #3

suhyunsim opened this issue Feb 9, 2021 · 0 comments
Assignees
Labels
브론즈 BOJ - 브론즈 성공 맞은 문제

Comments

@suhyunsim
Copy link
Owner

문제

핵심 아이디어

  • 입력 받고 같은걸 찾아서 count++

어려운 점, 실수

풀이

package main.java.com.poogle.BOJ.Q10807;

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];
        for (int i = 0; i < n; i++) {
            arr[i] = sc.nextInt();
        }
        int v = sc.nextInt();
        int cnt = 0;
        for (int i : arr) {
            if (i == v)
                cnt++;
        }
        System.out.println(cnt);
    }
}
@suhyunsim suhyunsim added 성공 맞은 문제 구현 브론즈 BOJ - 브론즈 labels Feb 9, 2021
@suhyunsim suhyunsim self-assigned this Feb 9, 2021
@suhyunsim suhyunsim added this to the 2월 1주 차 milestone Feb 14, 2021
@suhyunsim suhyunsim changed the title 21.02.09 - [BOJ] 10807. 개수 세기 21.02.07 - [BOJ] 10807. 개수 세기 Feb 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
브론즈 BOJ - 브론즈 성공 맞은 문제
Projects
None yet
Development

No branches or pull requests

1 participant