백준 - 11653 소인수분해
문제
11653 소인수분해
답
kotlin code
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
fun main() {
q11653()
}
fun q11653() {
var input = readln().toInt()
val minimumPrimeNumber = 2
for(i in minimumPrimeNumber..input) {
while (input % i == 0) {
println(i)
input /= i
}
if(input < minimumPrimeNumber) break
}
}
This post is licensed under CC BY 4.0 by the author.