fork download
  1. object Main {
  2. def main(args: Array[String]) {
  3. val inputs = readLine.split(" ")
  4. val n = inputs(0).toInt
  5. val mod = inputs(1).toInt
  6. var sum = 0
  7. for (i <- (1 to n)) {
  8. var myvar = readInt
  9. if (myvar % mod == 0) sum += 1
  10. }
  11. println(sum)
  12. }
  13. }
Success #stdin #stdout 0.37s 382016KB
stdin
7 3
1
51
966369
7
9
999996
11
stdout
4