Advertisement
random_wypok_user

Untitled

Feb 7th, 2022
329
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. euklides :: Int -> Int -> Int
  2. euklides a b
  3.         | b == 0 = a
  4.         | otherwise = euklides b (modulo a b)
  5.  
  6. modulo :: Int -> Int -> Int
  7. modulo a b
  8.         | a > b  = modulo (a - b) b
  9.         | a == b = 0
  10.         | otherwise = a
  11.  
  12. xs=[1..10]
  13. ys=[1..10]
  14.  
  15. main = do
  16.         print [((x, y), euklides x y) | x <- xs, y<-ys]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement