RosettaCodeData/Task/User-input-Text/Standard-ML/user-input-text.ml
Ingy döt Net 68f8f3e56b all tasks
2013-04-11 01:07:29 -07:00

7 lines
290 B
Standard ML

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