The French spell out numbers in a peculiar way.
- 1-16 are "normal"
- 17-19 are spelled out 10+7. 10+8, 10+9.
- 20-69 are "normal" (OK, OK! Not really, but they are in this challenge)
- 70-79 are 60+10, 60+11 ... 60+10+7, 60+10+8, 60+10+9.
- 80-99 are 4*20, 4*20+1, 4*20+2 ... 4*20+16, 4*20+10+7, 4*20+10+8, 4*20+10+9
Challenge:
Take a positive integer in the range [1,100], and output it the "French way". You must output it exactly as it's shown below, with *
and +
, so 97
is 4*20+10+7
, not [4 20 10 7]
or something else.
Test cases:
1 - 1
.. - ..
16 - 16
17 - 10+7
18 - 10+8
19 - 10+9
20 - 20
21 - 21
.. - ..
69 - 69
70 - 60+10
71 - 60+11
72 - 60+12
77 - 60+10+7
78 - 60+10+8
79 - 60+10+9
80 - 4*20
81 - 4*20+1
82 - 4*20+2
.. - ..
90 - 4*20+10
91 - 4*20+11
96 - 4*20+16
97 - 4*20+10+7
98 - 4*20+10+8
99 - 4*20+10+9
100 - 100
16
to10+7
above. (In English it happens between12
and10+3
, with a little more morphological disguise.) I've always been a little overobsessed with the fact that different languages make that transition at different numbers. \$\endgroup\$22
when "dix-huit" is10+8
? \$\endgroup\$