...
This commit is contained in:
parent
051504d65b
commit
0457928c3e
295 changed files with 3588 additions and 3 deletions
15
Task/Arithmetic-Integer/Haskell/arithmetic-integer.hs
Normal file
15
Task/Arithmetic-Integer/Haskell/arithmetic-integer.hs
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
main = do
|
||||
a <- readLn :: IO Integer
|
||||
b <- readLn :: IO Integer
|
||||
putStrLn $ "a + b = " ++ show (a + b)
|
||||
putStrLn $ "a - b = " ++ show (a - b)
|
||||
putStrLn $ "a * b = " ++ show (a * b)
|
||||
putStrLn $ "a to the power of b = " ++ show (a ** b)
|
||||
putStrLn $ "a to the power of b = " ++ show (a ^ b)
|
||||
putStrLn $ "a to the power of b = " ++ show (a ^^ b)
|
||||
putStrLn $ "a `div` b = " ++ show (a `div` b) -- truncates towards negative infinity
|
||||
putStrLn $ "a `mod` b = " ++ show (a `mod` b) -- same sign as second operand
|
||||
putStrLn $ "a `divMod` b = " ++ show (a `divMod` b)
|
||||
putStrLn $ "a `quot` b = " ++ show (a `quot` b) -- truncates towards 0
|
||||
putStrLn $ "a `rem` b = " ++ show (a `rem` b) -- same sign as first operand
|
||||
putStrLn $ "a `quotRem` b = " ++ show (a `quotRem` b)
|
||||
Loading…
Add table
Add a link
Reference in a new issue