[Haskell] Please help!!!
AVG
goncalves.v.andre at gmail.com
Sat Jun 9 15:22:02 EDT 2007
What's wrong??
greatest common divisor
code:
mdc :: Int-> Int -> Int
mdc _ 1 = 1
mdc 1 _ = 1
mdc x y
|x > y = mdc (x-y) y
|y > x = mdc (y-x) x
|x==y = x
mdcl :: [Int]-> [Int]
mdcl []=[]
mdcl l = mdcl ([mdc (tira(take 1 l)) (tira(take 1 (drop 1 l)))]++ drop 2 l)
gcdl :: [Int] -> Int
gcdl l = tira l
tira :: [Int] -> Int
tira []=0
tira [x]=x
--
View this message in context: http://www.nabble.com/Please-help%21%21%21-tf3895195.html#a11042870
Sent from the Haskell - Haskell mailing list archive at Nabble.com.
More information about the Haskell
mailing list