2016 Update
This commit is contained in:
parent
948b86eafa
commit
dcf5d15da3
7965 changed files with 139854 additions and 31002 deletions
19
Task/Loops-Nested/Kotlin/loops-nested.kotlin
Normal file
19
Task/Loops-Nested/Kotlin/loops-nested.kotlin
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
import java.util.Random
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
val r = Random()
|
||||
val a = Array(10) { IntArray(10) { r.nextInt(20) + 1 } }
|
||||
println("array:")
|
||||
for (i in a.indices) println("row $i: " + a[i].asList())
|
||||
|
||||
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