백준 - 2675 문자열 반복
문제
2675 문자열 반복
답
kotlin code
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import java.util.*
fun main() {
q2675()
}
fun q2675() = with(Scanner(System.`in`)) {
val inputs = List(nextInt()) { Pair(nextInt(), next().toCharArray()) }
for(input in inputs) {
val sb = StringBuilder(input.second.count() * input.first)
for(char in input.second) {
for (i in 1..input.first) {
sb.append(char)
}
}
println(sb)
}
}
This post is licensed under CC BY 4.0 by the author.