Created
June 19, 2013 15:08
-
-
Save suneo3476/5815057 to your computer and use it in GitHub Desktop.
三辺が整数であり、各辺の長さが10以下で、周の長さが24である直角三角形を求める。出典:Miran Lipovača『すごいHaskellたのしく学ぼう! 』p.22
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rightTriangle = [ (a,b,c) | c <- [1..10], a <- [1..c], b <- [1..a], a^2+b^2 == c^2, a+b+c == 24 ] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment