得到输入的等价物("What is your name")
Get the equivalence of input("What is your name")
在python中,我可以使用
向用户提问
response = input("What is your name?")
print(response)
我如何使用 Ocaml 做这样的事情?我觉得我可以
使用 read_line
,但我不确定如何等效。
这会起作用:
print_string "What is your name? ";
flush stdout;
let response = read_line () in
print_endline response
在python中,我可以使用
向用户提问response = input("What is your name?")
print(response)
我如何使用 Ocaml 做这样的事情?我觉得我可以
使用 read_line
,但我不确定如何等效。
这会起作用:
print_string "What is your name? ";
flush stdout;
let response = read_line () in
print_endline response