[코드업] 기초 100제 Java로 풀기 - 1093

곽준영·2023년 2월 24일
0
package codeup_100;

import java.util.Scanner;

public class codeup_93 {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt();
		
		int arr [] = new int [23];
		
		for(int i=0; i<n; i++) {
			int a = sc.nextInt();
			a=a-1;
			arr[a]=arr[a]+1;
		}
		for(int i=0; i<23; i++) {
			System.out.printf(arr[i]+ " ");
		}
	}
}
profile
I want to become a versatile freelancer programmer💻

0개의 댓글