RosettaCodeData/Task/User-input-Text/Standard-ML/user-input-text.ml

8 lines
290 B
OCaml
Raw Permalink Normal View History

2013-04-11 01:07:29 -07:00
print "Enter a string: ";
let val str = valOf (TextIO.inputLine TextIO.stdIn) in (* note: this keeps the trailing newline *)
print "Enter an integer: ";
let val num = valOf (TextIO.scanStream (Int.scan StringCvt.DEC) TextIO.stdIn) in
print (str ^ Int.toString num ^ "\n")
end
end