samedi 2 novembre 2019

Mathrandom java problemsolving

You get a chance to win the lottery and, you are very lucky as a programmer because the way to win the lottery is you can choose the number provided based on the number of people who received the lottery.

All people will be lined up according to the number selected then, a Judge will send 2 dice (D = d1 + d2). This judge will count from number 1 to number D and the person selected will lose the lottery and then come out of line. Then the judge will repeat the count from 1 after the person who was previously selected. And it keeps repeating until it remains, only 1 person wins the lottery.

Enter:

There will be a testcase T (0

Number of people who joined the lottery (0

Output:

The person who wins the lottery




Aucun commentaire:

Enregistrer un commentaire