Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --a csoport
- --1 fel
- isDivs :: (Int, Int) -> Int -> Bool
- isDivs (a, b) x = mod a x == 0 || mod b x == 0
- --2 fel
- numberedABC :: Char -> [(Int,Char)]
- numberedABC c = zip [1..] [myChar | myChar <- ['a' .. c]]
- --3 fel
- squareSum :: [Int] -> Int
- squareSum a = sum [i*i | i <- a]
- --4 fel
- greatCoord :: (Int,Int) -> Bool
- greatCoord (x, y) = mod x 10 == 0 && x * 2 == y
- --5 fel
- scholars :: [(String, String, Double)] -> Double -> [String]
- scholars list m = [ name ++ " - " ++ code | (name, code, i) <- list, i >= m]
- --6 fel végtelen
- howMany :: [Char] -> Char -> Int
- howMany str c = length $ filter (== c) str
- --7 fel
- leaveSeconds :: [Char] -> [Char]
- leaveSeconds [] = []
- leaveSeconds (x:[]) = x : []
- leaveSeconds (x:y:ys) = x : leaveSeconds ys
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement