package test_33
import 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).toInt
val shuxue = arr (2).toInt
val yingyu = arr (3).toInt
val total = yuwen + shuxue + yingyu
val avg = total / 3
println ("当前行是", name, yingyu, total, avg)
}
}
}
学习成绩排名
为小三离家出走2024-11-28 14:45
相关推荐
与仪共舞3 天前
罗德与施瓦茨 NRP18S|三路二极管射频功率传感器howard20056 天前
1.8.3 掌握Scala类与对象 - Scala基本骨架方法howard20057 天前
1.9 掌握Scala抽象类与特质howard20058 天前
1.8.2 掌握Scala类与对象 - 单例对象与伴生对象howard200510 天前
1.7.1 掌握Scala函数 - 声明Scala函数howard200512 天前
1.6.4 掌握Scala数据结构 - 元组howard200512 天前
1.6.5 掌握Scala数据结构 - 集合蓝眸少年CY13 天前
Scala - 基础教程howard200513 天前
1.6.3 掌握Scala数据结构 - 映射亿牛云爬虫专家14 天前
拒绝代理池雪崩:Scala + Akka 构建高并发的路由分发实战