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
相关推荐
geilip2 天前
知识体系_scala_利用scala和spark构建数据应用Hello.Reader2 天前
Flink 高级配置发行版剖析、Scala 版本、Table 依赖与 Hadoop 集成实战IvanCodes6 天前
八、Scala 集合与函数式编程卓码软件测评7 天前
第三方软件测试公司:【Gatling基于Scala的开源高性能负载测试工具】南棱笑笑生8 天前
20250931在RK3399的Buildroot【linux-6.1】下关闭camera_engine_rkisp今天没有盐10 天前
内建控制-循环语句while昕昕恋恋11 天前
定向和访问成员变量IvanCodes13 天前
七、Scala 包、样例类与样例对象浩浩kids13 天前
Scala • basisJava水解21 天前
Scala深入面向对象:类、对象与伴生关系