[백준] A-B (1001)(Kotlin)
[백준] A-B
문재 풀이1
import java.io.BufferedReader
import java.io.InputStreamReader
fun main() = with(BufferedReader(InputStreamReader(System.`in`))) {
val (a: Int, b: Int) = readLine()
.split(" ")
.map { it.toInt() }
println(a - b)
}
문제 풀이2
import java.io.BufferedReader
import java.io.InputStreamReader
fun main() = with(BufferedReader(InputStreamReader(System.`in`))) {
println(
readLine()
.split(" ")
.map { it.toInt() }
.reduce{ a, b -> a - b }
)
}