Guest User

Untitled

a guest
Jan 13th, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. OCAML
  2. let pole (a,b,c) =
  3. let
  4. abs x =
  5. if(x<0.) then -.x
  6. else x
  7. and
  8. p = (a+.b+.c)/.2.
  9. in
  10. if(abs(b-.c)<a && a<(b+.c)) then sqrt (p*.(p-.a)*.(p-.b)*.(p-.c))
  11. else raise (Failure "Nie da sie zbudowac trojkata");;
  12.  
  13. OZ...
  14. declare fun {Zad1 A#B#C}
  15. local fun {Abs X}
  16. if X<0 then -X
  17. else X end
  18. end
Add Comment
Please, Sign In to add comment