mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-07 08:31:28 +00:00
13 lines
197 B
Kotlin
Vendored
13 lines
197 B
Kotlin
Vendored
fun box(): String {
|
|
return if (call(10, ::calc) == 5) "OK" else "fail"
|
|
}
|
|
|
|
fun calc(p: Int): Int {
|
|
return p / 2
|
|
}
|
|
|
|
inline fun call(p: Int, s: (Int) -> Int): Int {
|
|
return s(p)
|
|
}
|
|
|
|
// 0 NEW |