Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
14
Task/Nested-function/Kotlin/nested-function.kotlin
Normal file
14
Task/Nested-function/Kotlin/nested-function.kotlin
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
// version 1.0.6
|
||||
|
||||
fun makeList(sep: String): String {
|
||||
var count = 0
|
||||
fun makeItem(item: String): String {
|
||||
count++
|
||||
return "$count$sep$item\n"
|
||||
}
|
||||
return makeItem("first") + makeItem("second") + makeItem("third")
|
||||
}
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
print(makeList(". "))
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue