vault backup: 2023-10-02 14:33:50

This commit is contained in:
Louis Gallet 2023-10-02 14:33:50 +02:00
parent 3942739253
commit 3cbc1b2470
Signed by: lgallet
SSH Key Fingerprint: SHA256:qnW7pk4EoMRR0UftZLZQKSMUImbEFsiruLC7jbCHJAY

View File

@ -1,8 +1,19 @@
## 1.1
```Ocaml
let product n =
if n = [] then
## 1.1 - Product
```
let rec product = function
| [] -> 0
| x::t -> x + product t;;
```
## 1.2 - Count
```
let rec count x n =
if x = [] then
0
else
let rec p =
else
let e::t = x
if e = x then
1 + count t n
else
count t n
```