728x90
import java.util.Scanner;
public class NumberOfAlphabet {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String s = sc.nextLine();
int[] arr =new int[26];
for (int i=0; i<26;i++){
arr[i]=0;
}
for (int i = 0; i < s.length(); i++) {
char c = s.charAt(i);
if (c >= 'a' && c <= 'z') {
arr[c-'a']++;
}
}
for (int i = 0; i < 26; i++) {
System.out.print(arr[i]+" ");
}
}
}
728x90
'백준' 카테고리의 다른 글
백준 10820 - Java (0) | 2024.09.21 |
---|---|
백준 10809 - Java (0) | 2024.09.21 |
백준 1918 - Java (0) | 2024.09.21 |
백준 1935 - Java (0) | 2024.09.19 |
백준 17299 - Java (0) | 2024.09.19 |