Let's use this simple question to test your logic thinking andAlgorithmCapability. If you can write the implementation algorithm within three hours, congratulations! You have become a master.ProgramPotential capabilities of Members. If you write an algorithm within three days, you can become a cool-man programmer. If it can be written within three weeks, you are a normal programmer's level of thinking. If you haven't written it out for two months, your IQ is not suitable for programmers. Give up early. I can tell you the answer is 10. I have already written a false reference.CodeAnd I will paste it later. Who can write it in Tianya? Please refer to the question:
There are 17 people in a circle (numbered 0 ~ 16) the number of people from 0th starts to report data from 1. All people reporting data to 3 leave the circle and count the number until there is only one person left, what is the original location of this person?
Just a loop is enough.
List <int> List = new list <int> () {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 };
Int COUNT = 1, curindex = 0;
While (list. Count> 1)
{
If (count ++ % 3 = 0)
List. removeat (curindex );
Else
Curindex ++;
If (curindex> = List. Count)
Curindex = 0;
}
Console. writeline (list [0]. tostring (); http://www.cnblogs.com/tonybinlj/archive/2009/01/04/1367856.html