https://www.acmicpc.net/problem/2577

내 답안
import java.util.Arrays;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
int A = s.nextInt();
int B = s.nextInt();
int C = s.nextInt();
int N = A * B * C;
int[] cnt = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
int idx;
while((float)N/10 >= 0.1) {
idx = N%10;
cnt[idx]++;
N/=10;
}
for (int i=0; i<cnt.length; i++) {
System.out.println(cnt[i]);
}
}
}
'Coding Test > 백준' 카테고리의 다른 글
[백준 1546번 - java] 평균 (0) | 2021.11.12 |
---|---|
[백준 3052번 - java] 나머지 (0) | 2021.11.12 |
[백준 2562번 - java] 최댓값 (0) | 2021.11.08 |
[백준 10818번 - java] 최소, 최대 (0) | 2021.11.08 |
[백준 1110번 - java] 더하기 사이클 (0) | 2021.11.04 |