update ocaml file

This commit is contained in:
2025-09-15 18:05:39 +02:00
parent 92632d3039
commit 1b9ae718f6
2 changed files with 43 additions and 1 deletions

View File

@@ -24,4 +24,23 @@ let ctc x =
else invalid_arg"somme pas egale a 9"
else invalid_arg"3 non pairs";;
ctc 2025;;
let day d m y =
if m=1||m=3||m=5||m=7||m=8||m=10||m=12 then
if d>1 && d<31 then
d,m,y
else failwith ""
else if m=2 then
if d>1 && d<28 then
d,m,y
else failwith ""
else if m=4||m=6||m=9||m=10 then
if d>1 && d<30 then
d,m,y
else
failwith ""
else failwith "";;
day 12 9 2024;;