Advertisement
Guest User

fibnum

a guest
Dec 9th, 2016
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. main = do
  2. words2 <- readInts
  3. let fiblist = take 100 (fibo 0 1)
  4. print $ fibcheck words2 fiblist
  5.  
  6. readInts :: IO [Integer]
  7. readInts = fmap (map read.words) getLine
  8.  
  9. fibo a b = a:fibo b (a+b)
  10.  
  11. fibcheck :: [Integer] -> [Integer] -> Bool
  12. fibcheck [] _ = True
  13. fibcheck (x:xs) ys = elem x ys && fibcheck xs ys
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement