langs a-z
This commit is contained in:
parent
db842d013d
commit
d066446780
11389 changed files with 98361 additions and 1020 deletions
9
Task/FizzBuzz/OCaml/fizzbuzz.ocaml
Normal file
9
Task/FizzBuzz/OCaml/fizzbuzz.ocaml
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
let output x =
|
||||
match x mod 3 = 0, x mod 5 = 0 with
|
||||
true, true -> "FizzBuzz"
|
||||
| true, false -> "Fizz"
|
||||
| false, true -> "Buzz"
|
||||
| false, false -> string_of_int x
|
||||
|
||||
let _ =
|
||||
for i = 1 to 100 do print_endline (output i) done
|
||||
Loading…
Add table
Add a link
Reference in a new issue