Skip to content

Instantly share code, notes, and snippets.

@suneo3476
Created June 19, 2013 15:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save suneo3476/5815057 to your computer and use it in GitHub Desktop.
Save suneo3476/5815057 to your computer and use it in GitHub Desktop.
三辺が整数であり、各辺の長さが10以下で、周の長さが24である直角三角形を求める。出典:Miran Lipovača『すごいHaskellたのしく学ぼう! 』p.22
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