G
G
GR212019-03-20 16:16:21
bash
GR21, 2019-03-20 16:16:21

Day of the year: count on 1, 2, 3...10. Formula?

Good day!
Depending on the day of the year 1...365, select one of 10 directories. How to pay for the first or second at the physical, then pay for the first ... tenth.
Is there a formula? Or will it be necessary to decompose into arrays in a cycle from 1..365?
PHP array example:
[1] => [1, 11, 21, n1],
[2] => [2, 12, 22, n2],
[3] => [3, 13, 23, n3],
[4] => [4, 14, 24, n4],
[5] => [5, 15, 25, n5],
[6] => [6 , 16, 26, n6],
[7] => [7, 17, 27, n7],
[8] => [8, 18, 28, n8],
[9] => [9, 19, 19, n9],
[10] => [10, 20, 30, n10],
Without an array using a formula, can you somehow calculate in one step?
Sincerely,
Alexey.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
EVGENY T., 2019-03-20
@GR21

Division with remainder - look at the math textbook for grade 3.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question