Update all new Tasks
This commit is contained in:
parent
00a190b0a6
commit
91df62d461
5697 changed files with 93386 additions and 804 deletions
13
Task/File-input-output/OCaml/file-input-output-1.ocaml
Normal file
13
Task/File-input-output/OCaml/file-input-output-1.ocaml
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
let () =
|
||||
let ic = open_in "input.txt" in
|
||||
let oc = open_out "output.txt" in
|
||||
try
|
||||
while true do
|
||||
let s = input_line ic in
|
||||
output_string oc s;
|
||||
output_char oc '\n';
|
||||
done
|
||||
with End_of_file ->
|
||||
close_in ic;
|
||||
close_out oc;
|
||||
;;
|
||||
12
Task/File-input-output/OCaml/file-input-output-2.ocaml
Normal file
12
Task/File-input-output/OCaml/file-input-output-2.ocaml
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
let () =
|
||||
let ic = open_in "input.txt" in
|
||||
let oc = open_out "output.txt" in
|
||||
try
|
||||
while true do
|
||||
let c = input_char ic in
|
||||
output_char oc c
|
||||
done
|
||||
with End_of_file ->
|
||||
close_in ic;
|
||||
close_out oc;
|
||||
;;
|
||||
Loading…
Add table
Add a link
Reference in a new issue