Program code
Results
Experimental summary
Because the water king is the entire forum post and the number of replies to add up the person, and more than half of the total number of posts. (Here the number of posts and replies are recorded together) using the "22 phase elimination" method. The author ID of the post is included in the array, and a number in the array is credited as the suspected water king, and the number of posts t=0. Iterate through the array, if the number in the array and the suspected water King ID is the same, so that the number of posts T plus one. If it is different from the suspected water King ID, make the post number T minus one. When t=0, the number of the array currently compared with the water king suspect as the new suspected water king. The end of the cycle, the current water king suspect is the water king.
Find water King-class homework