Post

[백준/코틀린] 10951번: A+B - 4

브론즈 5

링크

10951번: A+B - 4

풀이

EOF 예외가 발생할 때까지 반복하여 입력을 처리합니다.

코드

1
2
3
4
5
6
7
8
9
10
11
12
fun main() {
    while (true) {
        try {
            val (a, b) = readln().split(" ").map { it.toInt() }

            println(a + b)
        } catch (_: Exception) {
            return
        }
    }
}

This post is licensed under CC BY 4.0 by the author.