noritsuguの日記

2009-04-11``Algorithms'' (36) Exercise 2.7

(a)

Prelude> [ (x, y) | x <- [1..2], y <- [2..5], (x+y) /= 4 ]
[(1,2),(1,4),(1,5),(2,3),(2,4),(2,5)]
Prelude> [ x | x <- [1..10], (x `mod` 2) == 0]
[2,4,6,8,10]

(b)

Prelude> [ x | x <- [1..15], x /= 9]
[1,2,3,4,5,6,7,8,10,11,12,13,14,15]
Prelude> [ x * ((-1) ^ x) | x <- [2..11]]
[2,-3,4,-5,6,-7,8,-9,10,-11]
Prelude> [ x * (-1) ^ x | x <- [2..11]]
[2,-3,4,-5,6,-7,8,-9,10,-11]

ObengObeng2012/12/20 23:33You write so hoestnly about this. Thanks for sharing!

slqewuslqewu2012/12/21 14:51UkM61Y <a href="http://uwuncjaufeqs.com/">uwuncjaufeqs</a>

auatcuquanyauatcuquany2012/12/21 23:29sWjfdU , [url=http://qgeqquresesi.com/]qgeqquresesi[/url], [link=http://mtekpwvsbosw.com/]mtekpwvsbosw[/link], http://qcnqsvxizxcj.com/

yivbpijmyivbpijm2012/12/22 23:10toy58L <a href="http://hkftrfqqniew.com/">hkftrfqqniew</a>

tdxlehyfntdxlehyfn2012/12/23 08:51MN8sfI , [url=http://splzlxazqnqm.com/]splzlxazqnqm[/url], [link=http://pyovfqepraun.com/]pyovfqepraun[/link], http://twnldgyoculx.com/

トラックバック - http://haskell.g.hatena.ne.jp/noritsugu/20090411