Tag: euler
Haskell and Pythagoras
by Anonymous on Jun.08, 2010, under Programming
I’m thoroughly enjoying Haskell (and my new syntax highlighter). Here’s my solution to Problem 9:
product $ head [ [a, b, c] | a <- [1..1000], b <- [1..1000], c <- [1000 - a - b], a ^ 2 + b ^ 2 == c ^ 2, a + b + c == 1000 ]