헷갈리는 작대기

han.user();·2023년 4월 11일
0

구름

목록 보기
17/20
post-thumbnail

import java.io.*;

class Main {
    public static void main(String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String input = br.readLine();

        int count1 = 0;
        int countI = 0;
        int countl = 0;
        int countgiho = 0;

        for (int i = 0; i < input.length(); i++) {
            char c = input.charAt(i);
            if (c == '1') {
                count1++;
            } else if (c == 'I') {
                countI++;
            } else if (c == 'l') {
                countl++;
            } else if (c == '|') {
                countgiho++;
            }
        }
        System.out.println(count1);
        System.out.println(countI);
        System.out.println(countl);
        System.out.println(countgiho);
    }
}
profile
I'm still hungry.

0개의 댓글