varargs

fukurou

the supreme coder
ADMIN
Kotlin:
fun sum1(vararg values: Int): Int {
    var total = 0
    for (i in values.indices) {
        total += values[i]
    }
    return total
}
println(sum1(1,2,4))
 
Top