mirror of
https://github.com/MartinThoma/LaTeX-examples.git
synced 2025-04-26 06:48:04 +02:00
Cut (Prolog) hinzugefügt; weitere Scala-Beispiele hinzugefügt
This commit is contained in:
parent
6829f6cf97
commit
20994f6cc3
7 changed files with 101 additions and 1 deletions
|
@ -0,0 +1,12 @@
|
|||
object TwoBases {
|
||||
def test(x: Int, y: Int, z: Int) =
|
||||
(100*x + 10*y + z == math.pow(9,2)*z + 9*y + z)
|
||||
|
||||
def main(args: Array[String]) {
|
||||
for(x <- 0 to 9; y <- 0 to 9; z <- 0 to 9) {
|
||||
if(test(x, y, z)){
|
||||
println("%d%d%d".format(x, y, z));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue