fork download
  1. (* your code goes here *)
  2. let show l =
  3. let rec odd l =
  4. match l with
  5. [] -> ()
  6. | first :: rest ->
  7. if first / 2 * 2 <> first
  8. then (print_int first; print_char ' ')
  9. ; odd rest in
  10. let rec even l =
  11. match l with
  12. [] -> ()
  13. | first :: rest ->
  14. if first / 2 * 2 = first
  15. then (print_int first; print_char ' ')
  16. ; even rest in
  17. odd l; even l;;
  18.  
  19. show [-1; 2; 8; -9; -2; -3; -6; -10; -8; 5; 7; 9; 7];;
Success #stdin #stdout 0s 4472KB
stdin
Standard input is empty
stdout
-1 -9 -3 5 7 9 7 2 8 -2 -6 -10 -8