Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
14
Task/Integer-comparison/Standard-ML/integer-comparison-1.ml
Normal file
14
Task/Integer-comparison/Standard-ML/integer-comparison-1.ml
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
fun compare_integers(a, b) =
|
||||
if a < b then print "A is less than B\n"
|
||||
if a > b then print "A is greater than B\n"
|
||||
if a = b then print "A equals B\n"
|
||||
|
||||
fun test () =
|
||||
let
|
||||
open TextIO
|
||||
val SOME a = Int.fromString (input stdIn)
|
||||
val SOME b = Int.fromString (input stdIn)
|
||||
in
|
||||
compare_integers (a, b)
|
||||
end
|
||||
handle Bind => print "Invalid number entered!\n"
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
fun myCompare (a, b) = case Int.compare (a, b) of
|
||||
LESS => "A is less than B"
|
||||
| GREATER => "A is greater than B"
|
||||
| EQUAL => "A equals B"
|
||||
Loading…
Add table
Add a link
Reference in a new issue