fork(2) download
  1. fun water_vol (wh: int list) =
  2. let fun count_vol max hs acc =
  3. case hs of
  4. [] => acc
  5. | h2::hs' => if (max - h2) > 0 andalso (List.exists (fn x => x >= max) hs')
  6. then count_vol max hs' (acc+max-h2)
  7. else if (max - h2) > 0
  8. then count_vol (max - 1) hs acc
  9. else count_vol h2 hs' acc
  10. in
  11. count_vol (hd wh) (tl wh) 0
  12. end
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:1: error: class, interface, or enum expected
fun water_vol (wh: int list) =
^
Main.java:5: error: unclosed character literal
	      | h2::hs' => if (max - h2) > 0 andalso (List.exists (fn x => x >= max) hs')
	              ^
Main.java:5: error: unclosed character literal
	      | h2::hs' => if (max - h2) > 0 andalso (List.exists (fn x => x >= max) hs')
	                                                                               ^
Main.java:6: error: unclosed character literal
			   then count_vol max hs' (acc+max-h2)
			                        ^
Main.java:9: error: unclosed character literal
			   else count_vol h2 hs' acc
			                       ^
5 errors
stdout
Standard output is empty