본문 바로가기
PS/Baekjoon

[Baekjoon] 25640 - MBTI

by 서현 SEOHYEON 2023. 5. 21.

📝 문제

 

 

 

🔓 답안

import java.io.*;

public class Main {

    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));

        String jinho = br.readLine();
        int N = Integer.parseInt(br.readLine());

        int count = 0;
        for(int i = 0; i < N; i++){
            if(br.readLine().equals(jinho))
                count++;
        }

        bw.write(count + "\n");
        bw.flush();
        bw.close();
    }

}

 

 

🖤 알고리즘 분류

- 구현

- 문자열

댓글