Remember that there was a run of men there is a chicken and rabbit cage problem, said the chicken rabbit cage, a total of 35 head, 94 legs, asked how many chickens? How many rabbits?
Today's whim to use the recent Java knowledge to do this problem, of course, the result of the problem I was written calculation out, in order to verify the correctness of the output, not to say, directly on the code:
In fact, from the order of view will find that the code is more and more simple, and finally even give up the use of the loop to complete, completely into a mathematical formula, but at that time, I had just done, I fully merely two hours to clear the train of thought, then a few more easily made out.
Thinking is very important, want to self-accomplish a thing must have clear ideas, this is just a very simple topic, but let me learn a lot.
Multi-solution of chicken-Rabbit cage problem