mirror of
https://github.com/idris-lang/Idris2.git
synced 2024-12-26 13:11:30 +03:00
11 lines
266 B
Idris
11 lines
266 B
Idris
module Main
|
|
|
|
triples : Int -> List (Int, Int, Int)
|
|
triples top = [(x,y,z) | z<-[1..top], y<-[1..z], x<-[1..y],
|
|
x * x + y * y == z * z ]
|
|
|
|
main : IO ()
|
|
main = do putStrLn "Max: "
|
|
max <- getLine
|
|
printLn (triples (cast max))
|