Home 백준 - 4153 직각삼각형
Post
Cancel

백준 - 4153 직각삼각형

문제

4153 직각삼각형

screencaptures

kotlin code

1
2
3
4
5
6
7
8
9
10
11
12
13
fun main() {
    val output = StringBuilder()
    while (true) {
        readln().run {
            val (a, b, c) = this.split(" ").map { it.toInt() * it.toInt() }.sorted()
            if (a + b + c == 0) {
                print(output)
                return
            }
            output.append(if (a + b == c) "right\n" else "wrong\n")
        }
    }
}
This post is licensed under CC BY 4.0 by the author.

백준 - 2231 분해합

백준 - 1012 유기농 배추