~/algor $ cat problems/funksiya-yoshni-hisoblash
Calculating age
Write a function Age(d1, m1, y1, d2, m2, y2) that returns the age of a person born on $d_{1}.m_{1}.y_{1}$ on the date $d_{2}.m_{2}.y_{2}$ — the number of full years that have passed. For a person born on February $29$, the birthday in a non-leap year is March $1$.
Example 1: Age(15, 3, 2000, 20, 6, 2024) → 24
Example 2: Age(20, 9, 1995, 19, 9, 2024) → 28 — the birthday in $2024$ (September $20$) has not come yet.
Write only the function body.
Input
One line with six positive integers: $d_{1}$, $m_{1}$, $y_{1}$ (the date of birth: day, month, year) and $d_{2}$, $m_{2}$, $y_{2}$ (today's date) — the arguments of the function.
Output
The value returned by the function: an integer.
Note
$1 \le d_{1}, d_{2} \le 31$
$1 \le m_{1}, m_{2} \le 12$
$1900 \le y_{1}, y_{2} \le 2100$
The dates are valid; the date $d_{2}.m_{2}.y_{2}$ is not earlier than $d_{1}.m_{1}.y_{1}$.
Examples
15 3 2000 20 6 2024
24
20 9 1995 19 9 2024
28