lec 05 notes
This commit is contained in:
10 files changed
+249
No files matched your search
@@ -0,0 +1,12 @@
|
||||
let () =
|
||||
let rec aux sum =
|
||||
try
|
||||
aux @@ Scanf.scanf " %d" (fun x -> sum + x)
|
||||
with
|
||||
| Scanf.Scan_failure _ ->
|
||||
Scanf.scanf " %s" (fun _ -> ());
|
||||
aux sum
|
||||
| End_of_file -> sum
|
||||
in
|
||||
Printf.printf "%d\n" @@ aux 0;;
|
||||
|
||||
Reference in new issue
Block a user