-
Notifications
You must be signed in to change notification settings - Fork 127
/
solucao.kt
36 lines (30 loc) · 825 Bytes
/
solucao.kt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import java.io.EOFException
import java.lang.Exception
fun main(args: Array<String>)
{
while (true) {
try {
val l = readLine()!!.toInt()
val v = readLine()!!.split(" ").run { map { it.toInt() } }
val sorted = v.toTypedArray()
sorted.sort()
when (sorted.last()) {
in 0 .. 9 -> {
println(1)
}
in 10 .. 19 -> {
println(2)
}
else -> {
println(3)
}
}
} catch (f: Exception) {
break
} catch (n:Exception) {
break
} catch (e:Exception) {
break
}
}
}