Hexa
10/17/2019, 8:46 PMfun main(args : Array<String>) {
val input = Scanner(System.`in`)
while (true) {
var currentMax =0;
var iWithCurrentMax =0;
for (i in 0 until 8) {
val mountainH = input.nextInt()
if(mountainH >currentMax){
currentMax = mountainH;
iWithCurrentMax = i;
}
}
println(iWithCurrentMax)
}
}
tschuchort
10/17/2019, 8:48 PMpakoito
10/17/2019, 8:48 PMHexa
10/17/2019, 8:54 PMpakoito
10/17/2019, 8:56 PM(Continue) -> IO<Either<Stop, Continue>>
, where Stop is the final state, and Continue is the intermediate one, and IO is what you use to wrap the nextInt()
safelypakoito
10/17/2019, 8:58 PMpakoito
10/17/2019, 8:59 PMpakoito
10/17/2019, 8:59 PMHexa
10/17/2019, 9:01 PM