C++ Assignment Jon lee is the Sheriff and all criminals are afraid of the Jon. The Sheriff always fights crime, but when the criminals lie down, he gets bored and starts having fun. This time the Jon...


C++ Assignment<br>Jon lee is the Sheriff and all criminals are afraid of the Jon. The Sheriff always fights crime,<br>but when the criminals lie down, he gets bored and starts having fun.<br>This time the Jon gathered all the robbers in his garden and ordered them to line up. After<br>the whistle all robbers must change their position.<br>The Sheriff provided all the numbers of the robbers from 1 to N. In each place i decided a<br>unique position j. After blowing the whistle the resident robber instead I have to run to the<br>j-th place. The Sheriff liked to see how the robbers were going, and he continued to whistle<br>until late in the evening. He ended the game only when he realized that the robbers were in<br>the same order as before.<br>Now the Sheriff asks the question: How many times have you whistled?<br>Input:<br>1<br>3<br>123<br>Output:<br>1<br>

Extracted text: C++ Assignment Jon lee is the Sheriff and all criminals are afraid of the Jon. The Sheriff always fights crime, but when the criminals lie down, he gets bored and starts having fun. This time the Jon gathered all the robbers in his garden and ordered them to line up. After the whistle all robbers must change their position. The Sheriff provided all the numbers of the robbers from 1 to N. In each place i decided a unique position j. After blowing the whistle the resident robber instead I have to run to the j-th place. The Sheriff liked to see how the robbers were going, and he continued to whistle until late in the evening. He ended the game only when he realized that the robbers were in the same order as before. Now the Sheriff asks the question: How many times have you whistled? Input: 1 3 123 Output: 1

Jun 05, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here