ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • boj)10808
    PS/boj 2020. 8. 22. 12:34
    import java.util.Scanner;
    
    public class Main {
        public static void main(String[] args) {
    
            Scanner scanner = new Scanner(System.in);
    
            String s = scanner.next();
    
            // 알파벳 26개
            int[] arr = new int[26];
    
            //
            for (int i = 0; i < s.length(); i++) {
                int a = s.charAt(i)-97;
                arr[a]++;
            }
    
            // 출력
            for (int i = 0; i < arr.length; i++) {
                System.out.print(arr[i] + " ");
            }
    
    
        }
    }
    
    

     

    www.acmicpc.net/problem/10808

    'PS > boj' 카테고리의 다른 글

    boj)1919  (0) 2020.08.23
    boj)13330  (0) 2020.08.23
    boj)11328  (0) 2020.08.23
    boj)2577  (0) 2020.08.23
    boj)10871  (0) 2020.08.22
킹수빈닷컴