Last active
September 30, 2022 07:25
-
-
Save mikaello/4900fcbd55ff34c7f8c84f3a2d75bca2 to your computer and use it in GitHub Desktop.
Read stdin with Kotlin, util for Kattis input parsing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun readString() = readLine()!! | |
fun readStrings() = readString().split(" ") | |
fun readInt() = readString().toInt() | |
fun readInts() = readStrings().map { it.toInt() } | |
fun readLong() = readString().toLong() | |
fun readLongs() = readStrings().map { it.toLong() } | |
fun readDouble() = readString().toDouble() | |
fun readDoubles() = readStrings().map { it.toDouble() } | |
fun main(){ | |
val (a,b) = readInts() | |
println(a+b) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment