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
相关推荐
BD_Marathon10 小时前
sbt 编译打包 scala927411 小时前
26 trait-多继承详解渣渣盟2 天前
Flink分布式文件Sink实战解析-大头.2 天前
Scala全链路实战:零基础到生产级今天没有盐2 天前
Scala 访问权限详解:private、protected 与 privateZHOUZAIHUI5 天前
WSL(Ubuntu24.04) 安装PostgreSQLchde2Wang5 天前
运行scala文件报错xsbt.CompilerInterface零碎岛119 天前
scala中trait基本使用lucky_syq17 天前
Scala与Spark算子:大数据处理的黄金搭档深兰科技20 天前
廊坊市市长刘媛率队到访深兰科技,推动机器人制造基地与产业投资落地