I agree with pktrivedi in that if all of the ministers chose a different number, the king's riddle would not work. However, as BigTime pointed out, the king was probably testing his ministers. The obvious solution was zero, and if anyone didn't pick that, the cabinet would be replaced.
For those who focused on the wording, the condition "if anyone selects a wrong number" only defines the consequence "the group will be beheaded," and the implied "otherwise" defines the consequence "[the group] will go home with a booty of 100 coins each." The "or" separates these. The sentence isn't questionable.
And like K4D said, the point of this forum is to solve the given riddles, not to point out minor flaws and loopholes. As long as the meaning is understood and a reasonable, valid answer can be deduced, the point should be to find the answer. I think it's okay to point out flaws as long as the answer is acknowledged and as long as it is done good-heartedly rather than derisively.