• Home
  • About
    • Moon photo

      Moon

      개발자는 자고 싶다.

    • Learn More
    • Twitter
    • Facebook
    • Instagram
    • Github
    • Steam
  • Posts
    • All Posts
    • All Tags
  • Projects

백준 - 4153 직각삼각형

05 Jun 2022

Reading time ~1 minute

문제

4153 직각삼각형

screencaptures

답

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


baekjoonkotlin코틀린백준브론즈수학기하학피타고라스 정리 Share Tweet +1