Написал isCongruent

This commit is contained in:
2024-11-29 19:24:05 +03:00
parent 69e7f5537a
commit 1aa359b5c1
2 changed files with 7 additions and 4 deletions

View File

@@ -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)

View File

@@ -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