package test_33import scala.io.Source object test {def main(args: Array[String]): Unit = {val it = Source.fromFile ("score.txt").getLines ().drop (1) while (it.hasNext) {val content = it.next ()val arr = content.split (",")val name = arr (0)val yuwen = arr (1).toIntval shuxue = arr (2).toIntval yingyu = arr (3).toIntval total = yuwen + shuxue + yingyuval avg = total / 3println ("当前行是", name, yingyu, total, avg)} } }