백준 - 2577 숫자의 개수
문제
2577 숫자의 개수
답
kotlin code
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import java.util.*
fun main() {
q2577()
}
fun q2577() = with(Scanner(System.`in`)) {
val requests = Array(3) {nextInt()}
val charArray = requests.reduce{acc, i -> acc * i}.toString().toCharArray().map { Character.getNumericValue(it)}
for(i in 0..9) {
println(charArray.count { it == i })
}
}
This post is licensed under CC BY 4.0 by the author.