diff --git a/lab4/app/Main.hs b/lab4/app/Main.hs index 4c6b30f..33000ba 100644 --- a/lab4/app/Main.hs +++ b/lab4/app/Main.hs @@ -3,4 +3,7 @@ module Main (main) where import Lib main :: IO () -main = someFunc +main = do + putStrLn $ "Примеры работы `isCongruent`" + putStrLn $ "isCongruent 10 12 2: " ++ show (isCongruent 10 12 2) + putStrLn $ "isCongruent 10 11 2: " ++ show (isCongruent 10 11 2) \ No newline at end of file diff --git a/lab4/src/Lib.hs b/lab4/src/Lib.hs index d36ff27..382853f 100644 --- a/lab4/src/Lib.hs +++ b/lab4/src/Lib.hs @@ -1,6 +1,6 @@ module Lib - ( someFunc + ( isCongruent ) where -someFunc :: IO () -someFunc = putStrLn "someFunc" +isCongruent :: Int -> Int -> Int -> Bool +isCongruent a b d = a `mod` d == b `mod` d