Guest User

фывыф

a guest
Feb 28th, 2021
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. module Lab1 where
  2.  
  3. square :: Int->Int
  4. square x = x*x
  5.  
  6. prod :: Int->Int->Int
  7. prod x y = x*y
  8.  
  9. z = if True then 1 else 2
  10.  
  11. ispositive :: Int->Bool
  12. ispositive x = if x>0 then True else False
  13.  
  14. singnum :: Int->Int
  15. singnum x = if x>0 then 1 else if x<0 then -1 else 0
  16.  
  17. max3 :: Int->Int->Int->Int
  18. max3 a b c = if a>b && a>c then a else if b>a && b>c then b else c
  19.  
  20. sort2 :: Int->Int->(Int,Int)
  21.  
  22. bothTrue :: Bool->Bool->Bool
  23. bothTrue :: ne ispolzyite logi4eskie operatsii
  24.  
  25. solvel :: Double->Double->(Bool,Double)
  26. true esli resh syshestvyet false v protivnom sluchae
  27. pri etom vtoroi element ravent znach kornya libo nylu
  28.  
  29. isParallel :: Double->Double->Double->Double->Bool
  30. true esli dva otrezka konci kotorih zadautsya v argumentah funkcii parallelni false esli net
  31.  
  32. isIncluded :: Double->Double->Double->Double->Double->Double->Bool
  33. true esli vtoraya vnytri pervoi
  34.  
  35. isRectangular :: Double->Double->Double->Double->Double->Double->Bool
  36. true esli pryamoygolniy
  37.  
  38. isTriangle :: Double->Double->Double->Double->Double->Double->Bool
  39. true esli treugolnik
  40.  
  41. isSorted :: Int->Int->Int->Bool
  42. true esli sorted
  43.  
  44.  
Advertisement
Add Comment
Please, Sign In to add comment