1
我在我的代码中有一个错误。你能帮助我吗,并告诉我如何使用函数,它在if语句中返回布尔值?OCaml。关于如果陈述
let pol a b c =
let p=(a+.b+.c)/.2.0 in sqrt(p*.(p-.a)*.(p-.b)*.(p-.c));;
let test a b c =
(a+.b)>c &&(b+.c)>a &&(a+.c)>b
let main a b c =
let w=test(a b c) in(
if w
then pol (a b c)
else raise(Failure "Error"));;
WOW。大。非常感谢!!! –