- 论坛徽章:
- 0
|
Einstein wrote a riddle last century. He said that 98% of the world could
not solve it.
Einstein's riddle
There are 5 houses in five different colors in a row.
In each house lives a person with a different nationality.
The five owners drink a certain type of beverage, smoke a certain brand of
cigar and keep a certain pet.
No owners have the same pet, smoke the same brand of cigar or drink the
same beverage.
The question is: Who owns the fish?
Einstein's hints:
1. The Brit lives in the red house
2. The Swede keeps dogs as pets
3. The Dane drinks tea
4. The green house is on the immediate left of the white house
5. The green house's owner drinks coffee
6. The person who smokes Pall Mall rears birds
7. The owner of the yellow house smokes Dunhill
8. The man living in the center house drinks milk
9. The Norwegian lives in the first house
10. The man who smokes blends lives next to the one who keeps cats
11. The man who keeps horses lives next to the one who smokes Dunhill
12. The owner who smokes BlueMaster drinks beer
13. The German smokes Prince
14. The Norwegian lives next to the blue house
15. The man who smokes blends has a neighbor who drinks water
Machine's solution(s):
http://wiki.woodpecker.org.cn/moin.cgi/PyPorgramGames_2fEinstein
这个是两种python的解法, 第二个是我写的, 用了不少python的特性.
谁用c写一个玩玩? |
|