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
相关推荐
Thomas21434 天前
Java scala 数组 链表江畔柳前堤6 天前
消息队列:从直觉到精通的完整认知地图hopsky20 天前
《Scala 学习手册》核心内容详解abcy0712131 个月前
scala playframework 搭建与新建controller教程lpfasd1231 个月前
编程语言榜单变迁分析戮漠summer2 个月前
Missing Semester 计算机教育中缺失的一课 Lecture 01 Shell醉熏的石头2 个月前
Ubuntu 中的编程语言(中)Irene19912 个月前
Scala、Java、Python、JavaScript 的核心特性和应用场景(Python 的“单机“局限性:GIL 机制导致的多核并行缺陷)李白的天不白3 个月前
确认 Nginx 配置文件是否真的生效醉颜凉3 个月前
Scala自定义Monad实战:从理论到应用的完整指南