Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- main :: IO()
- main = do
- putStr "Enter FB: "
- line1 <- getLine
- putStr "Enter FC: "
- line2 <- getLine
- let fb = read line1 :: Integer
- let fc = read line2 :: Integer
- print ((max (fibonacci fb) (factorial fc)))
- factorial :: Integer -> Integer
- factorial n
- | n == 0 = 0
- | n == 1 = 1
- | otherwise = n * factorial (n-1)
- fibonacci :: Integer -> Integer
- fibonacci n
- | n == 0 || n == 1 = 1
- | otherwise = fibonacci (n-2) + fibonacci (n-1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement