문제
코드
package step_by_step2;
import java.util.Arrays;
import java.util.Scanner;
public class Test04_2577 {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int a = scan.nextInt();
int b = scan.nextInt();
int c = scan.nextInt();
int mul = a*b*c;
String strNum = Integer.toString(mul); //곱을 스트링으로 변환
for(int i=0; i<10; i++) {
int count=0;
for(int j=0; j<strNum.length(); j++) {
if((strNum.charAt(j) - '0') == i) {
count++;
}
}
System.out.println(count);
}
}
}
'알고리즘 > 백준' 카테고리의 다른 글
[백준] 2562번 : 최댓값 (0) | 2021.09.10 |
---|---|
[백준] 11720번: 숫자의 합 (0) | 2021.08.30 |
[백준]10951번 : A + B - 4 (0) | 2021.08.26 |
[백준] 10952번 : A + B - 5 (0) | 2021.08.26 |
[백준] 2438번 : 별찍기 -1 / 2439번 : 별찍기 -2 (java) (0) | 2021.08.26 |