Решаване на проблеми за развиване на логическо мислене
Здравейте,
Споделям този пост с надеждата, че повече хора ще имат желанието, да развиват своето логическо мислене, чрез решаване на проблеми. Доброто логическо мислене - качество, което според мен, отличава успешният програмист от рутинният.
Ето и първият проблем : "How to cross the river ?"
A farmer with a fox, a goose, and a sack of corn needs to cross a river. The farmer has a rowboat, but there is room for only the farmer and one of his three items. Unfortunately, both the fox and the goose are hungry. The fox cannot be left alone with the goose, or the fox will eat the goose. Likewise, the goose cannot be left alone with the sack of corn, or the goose will eat the corn. How does the farmer get everything across the river ?
- източник на проблема - книга "Think like a Programmer"
http://www.wowebook.com/book/think-like-a-programmer/
За тези от вас, които са срещали този проблем, решили са го, и вече не им е интересен, моля споделете някой друг от вашият опит.
A: 2, 2, 9?
Since the sum cannot help, there must be at least two sets of numbers with the same sum. There is one pair of possible answers that have the same sum: {1, 6, 6} and {2, 2, 9}. Since there is an OLDEST daughter, the answer must be 2, 2, 9.