Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 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