Idris2/benchmark/benchmarks/triples/triples.idr
2021-01-12 13:22:58 +00:00

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))