e
Size: a a a
e
Д
e
AG
AB
VP
System.exit() при чтении символа из System.inМК
System.exit() при чтении символа из System.inИ
System.exit() при чтении символа из System.inИ
fun main() {
val mainThread = thread {
var i = 0
while (i < 1_000_000 && !Thread.currentThread().isInterrupted) {
try {
Thread.sleep(1000)
} catch (e: InterruptedException) {
break
}
println(i)
i += 1
}
// some cleanup here
}
val controlThread = thread(isDaemon = true) {
System.`in`.read()
mainThread.interrupt()
}
mainThread.join()
}
Ну то есть, условно говоря, что-то такоеAE