• Home
  • About
    • Moon photo

      Moon

      개발자는 자고 싶다.

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

백준 - 2869 달팽이는 올라가고 싶다

07 Jun 2022

Reading time ~1 minute

문제

2869 달팽이는 올라가고 싶다

screencapture

답

kotlin code

fun main() {
    q2869()
}

fun q2869() {
    val inputs = readln().split(" ").map { it.toDouble() }
    val tree = inputs[2] - inputs[0]
    var attempts = 1.0
    attempts += (tree / (inputs[0] - inputs[1]))
    println(kotlin.math.ceil(attempts).toInt())
}


baekjoonkotlin코틀린백준브론즈수학 Share Tweet +1