Kros Dai’ Blog No excuse, no panic

爱因斯坦的思考题

Einstein

  昨天报纸上看到个有趣的逻辑推理题,爱因斯坦声称世界上只有2%的人能解出:

  • 有五个具有五种不同颜色的房间排成一排;
  • 每个房间里分别住着一个不同国籍的人;
  • 每个人都在喝一种特定品牌的饮料,抽一特定品牌的烟,养一特定的宠物;
  • 没有任意两个人在抽相同品牌的香烟,或喝相同品牌的饮料,或养相同的宠物。

问题:谁在养鱼作为宠物?

爱因斯坦给出如下线索:

  1. 英国人住在红色的房子里;
  2. 瑞典人养狗作为宠物;
  3. 丹麦人喝茶;
  4. 绿房子紧挨着白房子,在白房子的左边;
  5. 绿房子的主人喝咖啡;
  6. 抽Pall Mall牌香烟的人养鸟;
  7. 黄色房子里的人抽Dunhill牌香烟;
  8. 住在中间那个房子里的人喝牛奶;
  9. 挪威人住在第一个房子里面;
  10. 抽Blends牌香烟的人和养猫的人相邻;
  11. 养马的人和抽Dunhill牌香烟的人相邻;
  12. 抽BlueMaster牌香烟的人和啤酒;
  13. 德国人抽Prince牌香烟;
  14. 挪威人和住在蓝房子的人相邻;
  15. 抽Blends牌香烟的人和喝矿泉水的人相邻。


  在http://www.codeproject.com/cpp/Einstein.asp上有人用C++编出一个exe,在我Celeron 2.4G的机器上运行时间基本为0.002秒。可惜偶不懂C++,看不懂他的思路……是该安排时间好好学学真正面向对象的语言了。下载C++的源代码


Einstein's riddle

  • There are 5 houses in five different colors in a row.
  • In each house lives a person with a different nationality.
  • These 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 man 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.
This site is licensed under a Creative Commons License .