mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-08 08:31:26 +00:00
9 lines
154 B
Kotlin
Vendored
9 lines
154 B
Kotlin
Vendored
// this script expects parameter num : Int
|
|
|
|
fun fib(n: Int): Int {
|
|
val v = if(n < 2) 1 else fib(n-1) + fib(n-2)
|
|
return v
|
|
}
|
|
|
|
val result = fib(num)
|