I have the following submission in scala for one of the practise questions at http://www.codechef.com/problems/INTEST/ and I keep getting compilation error. I compared it with other submissions and I just have a few lines of difference. But I still get a weird error. Please help.
object Main {
def main(args: Array[String]) {
val inputs = readLine.split(" ")
val n = inputs(0).toInt
val mod = inputs(1).toInt
var sum = 0
for (i <- (1 to n)) {
var myvar = readInt
if (myvar % mod == 0) sum += 1
}
println(sum)
}
}
Here is the compilation error.