Quantcast
Channel: CodeChef Discuss - latest questions
Viewing all articles
Browse latest Browse all 39796

Unable to understand the compilation error here.

$
0
0

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. http://www.codechef.com/view/error/2506294/


Viewing all articles
Browse latest Browse all 39796

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>