Author: Li Zhiyong published in SEOUL.
E-mail: Netsafe@sina.com
Please indicate the source.
The following questions believe that many people have heard: 1 has five five colors of the house 2 Every house owner nationality is different 3 these five people only drink a drink, only a brand of cigarettes, only Raise a pet 4 No one has the same pet, take the same brand of cigarettes, drink the same drink
prompt:
1. The British lives in the red house. The smoke of the smoke raised a bird 7, Huang House owner smokes Dunhill to smoke 8, live in the middle of the house to drink milk 9, Norwegian live the first house 10, the people who smoke smoke live in the fish Next to the 11th, the harmaman lives next to the people of Dunhill smoke 12, people who smoke Blue Master smoke drink beer 13, German smokes Prince to smoke 14, Norwegians live next to the blue house 15, smoke-mixed people's neighbors drink minerals water
The question is: Who rasted fish? This podium is from the German Logic Study of Berlin. It is said that only 2% of people in the world can answer. Even the famous Einstein has also become a big hunteau, so this question is often used by well-known companies at home and abroad, I believe that many friends only have a answer, if you happen, you belong to the 98% How to do it. It doesn't matter, if this problem is to solve it very easy. The program code is as follows:
Using system; namespace netsafe.math {public class aynt {///
/// 7, Huang House owner smokes Dunhill smoke /// if (Find (1, 1)! = Find (3, 1)) Continue; for (i4 = 1; i4 <= 120; i4 ) /// Beverage {For (int J = 0; j <5; J , Answer [J, 4] = All [J, I4]); /// 8, people living in can't drink milk /// if (all [3, i4]! = 4) Continue; /// 5, green house owner drink coffee /// if (Find (1, 5)! = Find (4, 1)) Continue; /// 3, Danish Drink tea /// if (Find (2, 4)! = Find (4, 3)) Continue; /// 15, 居 居 (Math.Abs (Find (3, 3) ) -find (4, 2))! = 1) Continue; /// 12, people smoking BLUE MASTER smoke drink beer /// if (Find (3, 5)! = Find (4, 5)) Continue; For (i5 = 1; i5 <= 120; i5 ) // / pet {for (int J = 0; J <5; J , Answer [J, 5] = all [j, i5]); /// 10 People who smoke mixed smoke live next to the fishman /// if (Math.Abs (Find (3, 3) -find (5, 1))! = 1) Continue; /// 2, Swedish A dog / // if (Find (2, 5)! = Find (5, 5)) Continue; /// 6, people who pumped Pall Mall smoke raised a bird /// if (Find (3, 4)! = Find (5, 4)) Continue; /// 11, the hippiece lives next to people of Dunhill smoke /// f (Math .Abs (5, 3) -find (3, 1))! = 1) Continue; // / / / can live to the DATA, of course, the answer // Write_answer ();}}}} }}} ///
/// summary> public void p () {Int ncount, njudge, key; nlevel ; if (Nlevel> 5) {WriteAll (); //////////////////////////> ;} For (ncount = 1; ncount <= 5; ncount ) {key = 0; for (njudge = 0; njudge <= nLEVEL-1; NJUDGE ) IF (ncount == List [njudge]) {key = 1; Break;} if (key == 0) {list [NLEVEL] = ncount; p ();}} nLEVEL ---;} ///
Yellow house, blue house, red house, green house, white house,
Norwegian, Danish, British, German, Sweden,
Dunhill, hybrid smoke, Pall Mall, Prince, Blue Master,
Mineral water, tea, milk, coffee, beer,
Fish, horse, bird, dinosaur, dog,
Green house, blue house, yellow house, red house, white house, Norwegians, German, Swedest, British, Danish, Hybrid, Prince, Dunhill, Blue Master, Pall Mall, Coffee, Miners, Milk, Beer, Tea, Dinosaur, Fish, Dog, Horse, Bird,
Green house, blue house, white house, yellow house, red house, Norwegian, German, Swedest, Danish, British, Pall Mall, Prince, Hybrid, Dunhill, Blue Master, Coffee, Mineral water, Milk, Tea, Beer, Bird, Fish, Dog, Dinosaur, Horse, Green House, Blue House, White House, Huang House, Red House, Norwegia, German, Sweden, Danish, British, Pall Mall, Prince, Mix Smoke, Dunhill, Blue Master, Coffee, Miners, Milk, Tea, Beer, Bird, Dinosaur, Dog, Fish, Horse,
Green house, blue house, white house, red house, yellow house, Norwegians, German, Swedish, British, Danish, Pall Mall, Prince, Hybrid, Blue Master, Dunhill, Coffee, Miners, Milk, Beer, Tea, Bird, Fish, Dog, Horse, Dinosaurs,
Green house, blue house, red house, yellow house, white house, Norwegian, German, British, Danish, Sweden, Pall Mall, Prince, Hybrid, Dunhill, Blue Master, Coffee, Mineral water, Milk, Tea, Beer, Bird, Fish, Horse, Dinosaur, Dog,
Green house, blue house, red house, yellow house, white house, Norwegian, German, British, Danish, Sweden, Pall Mall, Prince, Hybrid, Dunhill, Blue Master, Coffee, Mineral water, Milk, Tea, beer, bird, dinosaur, horse, fish, dog,