fix for while-loop-ending-with-if bug
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
import java.lang.Runtime
|
||||
|
||||
fun box() : String {
|
||||
val processors = Runtime.getRuntime().sure().availableProcessors()
|
||||
var threadNum = 1
|
||||
while(threadNum <= 1024) {
|
||||
System.out?.println(threadNum)
|
||||
if(threadNum < 2 * processors)
|
||||
threadNum += 1
|
||||
else
|
||||
threadNum *= 2
|
||||
}
|
||||
return "OK"
|
||||
}
|
||||
Reference in New Issue
Block a user