Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
18
Task/Loops-Nested/Kotlin/loops-nested.kotlin
Normal file
18
Task/Loops-Nested/Kotlin/loops-nested.kotlin
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
import kotlin.random.Random
|
||||
|
||||
fun main() {
|
||||
val a = Array(10) { IntArray(10) { Random.nextInt(1..20) } }
|
||||
println("array:")
|
||||
for (i in a.indices) println("row $i: ${a[i].contentToString()}")
|
||||
|
||||
println("search:")
|
||||
outer@ for (i in a.indices) {
|
||||
print("row $i:")
|
||||
for (j in a[i].indices) {
|
||||
print(" " + a[i][j])
|
||||
if (a[i][j] == 20) break@outer
|
||||
}
|
||||
println()
|
||||
}
|
||||
println()
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue