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
相关推荐
盛小夏8 小时前
用链式风格写代码,就像在搭积木盛小夏2 天前
元组(Tuple)详解:初学者必须掌握的数据结构赞鱼儿3 天前
Scala中函数的基本使用还是大剑师兰特4 天前
Scala面试题及详细答案100道(71-80)-- 与Java的交互92745 天前
12函数参数geilip9 天前
知识体系_scala_利用scala和spark构建数据应用Hello.Reader9 天前
Flink 高级配置发行版剖析、Scala 版本、Table 依赖与 Hadoop 集成实战IvanCodes13 天前
八、Scala 集合与函数式编程卓码软件测评14 天前
第三方软件测试公司:【Gatling基于Scala的开源高性能负载测试工具】南棱笑笑生15 天前
20250931在RK3399的Buildroot【linux-6.1】下关闭camera_engine_rkisp