Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import Data.List
- import Data.Char
- f1 :: Int -> Bool
- f1 1 = False
- f1 0 = True
- f1 x
- | x `mod` 2 == 0 = True
- | x `mod` 3 == 0 = True
- | x `mod` 5 == 0 = True
- | otherwise = False
- head2 :: [a] -> (a,a)
- head2 [x,y] = (x,y)
- head2 (x:xs) = (x,head xs)
- ratAdd :: (Int, Int) -> (Int, Int) -> (Int, Int)
- ratAdd (x,y) (z,w) = (w * x + y*z, y*w)
- fac :: Int -> Int
- fac 0 = 1
- fac n = n * (fac (n -1))
- minimumInt :: [Int] -> Int
- minimumInt [x] = x
- minimumInt [x,y] = x
- minimumInt (x:xs) = head(sort(x:xs))
- insert :: Int -> a -> [a] -> [a]
- insert x y z = take x z ++ y : drop x (z)
- minimumOfMaxima :: Ord a => [[a]] -> a
- minimumOfMaxima [x:xs]= minimum(maximum [x:xs])
- -- ez csak két eleműre működik
- safeHead :: [a] -> Maybe a
- safeHead [] = Nothing
- safeHead x =Just (head x)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement