문제
8958 OX퀴즈
답
kotlin code
import java.util.*
fun main() {
q8958()
}
fun q8958() = with(Scanner(System.`in`)) {
val count = nextInt()
val questions = Array(count){next()}
val result = Array(count){0}
for(i in 0 until count) {
var point = 0;
for(j in questions[i].toCharArray()) when(j) {
'X' -> point = 0
'O' -> result[i] += ++point
}
println(result[i])
}
}