4153 직각삼각형

June·2022년 6월 1일

[코딩 연습] BAEKJOON

목록 보기
5/16

문제

4153 직각삼각형

4153 직각삼각형

kotlin code

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")
        }
    }
}

0개의 댓글