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
相关推荐
lpfasd12318 小时前
编程语言榜单变迁分析戮漠summer23 天前
Missing Semester 计算机教育中缺失的一课 Lecture 01 Shell醉熏的石头1 个月前
Ubuntu 中的编程语言(中)Irene19911 个月前
Scala、Java、Python、JavaScript 的核心特性和应用场景(Python 的“单机“局限性:GIL 机制导致的多核并行缺陷)李白的天不白2 个月前
确认 Nginx 配置文件是否真的生效醉颜凉2 个月前
Scala自定义Monad实战:从理论到应用的完整指南那晚的她2 个月前
Scala中Set集合IvanCodes2 个月前
二、Scala流程控制:分支与循环Veggie262 个月前
【Scala PyTorch深度学习】PyTorch On Scala系列课程 第十四章 29 PyTorch模型扩展自定义Module【AI Infra3】[PyTorch Scala硕士研一课程】Clf丶忆笙2 个月前
搭建支持多语言开发的Quarkus环境:Java、Kotlin与Scala全栈指南