This commit is contained in:
2024-02-10 16:14:57 +01:00
parent 5d7694ce0f
commit 5a039bd152
23 changed files with 21 additions and 6 deletions

View File

@@ -10,5 +10,6 @@
<orderEntry type="library" name="openjfx.javafx.base" level="project" />
<orderEntry type="library" name="openjfx.javafx.graphics" level="project" />
<orderEntry type="library" name="openjfx.javafx.controls" level="project" />
<orderEntry type="library" name="scala-sdk-2.13.12" level="application" />
</component>
</module>

View File

@@ -0,0 +1,14 @@
package Klausur_ueb
object Lambda {
def main(args: Array[String]): Unit = {
val a = Array(1, 2, 3, 4, 5)
val summe = a.reduce((x: Int, y: Int) => x + y)
val summeKuerzer = a.reduce((x, y) => x + y)
val summeNochKuerzer = a.reduce(_ * _)
val summeGanzKurz = a.sum //vordefiniert
println(summeGanzKurz)
println(summeNochKuerzer)
}
}