ÐË»¯400Éú»îÍø

±êÌâ: °®Òò˹̹µÄÎÊÌâ [´òÓ¡±¾Ò³]

×÷Õß: ¡í»ðÈȤÎ˧    ʱ¼ä: 2006-4-19 11:13
±êÌâ: °®Òò˹̹µÄÎÊÌâ
<SPAN class=tpc_title>°®Òò˹̹µÄÎÊÌâ</SPAN><BR><IMG src="http://www.400.com.cn/images/Emotions/78.gif"><BR><SPAN class=tpc_content>ÕâÀïÓÐÒ»¸öºÜÀϵÄÌâÄ¿£¬¿´¿´ÄãÄÜÔڶ೤ʱ¼äÄÚ˵³ö´ð°¸¡£ <BR>¡¡¡¡ÎÊÌâÊÇ£ºÔÚÒ»Ìõ½ÖÉÏ£¬ÓÐ5×ù·¿×Ó£¬ÅçÁË5ÖÖÑÕÉ«£»Ã¿¸ö·¿Àïס×Ų»Í¬¹ú¼®µÄÈË£»Ã¿¸öÈ˺Ȳ»Í¬µÄÒûÁÏ£¬³é²»Í¬Æ·ÅƵÄÏãÑÌ£¬Ñø²»Í¬µÄ³èÎï¡£ÇëÎÊ£ºË­ÑøÓ㣿 <BR>¡¡¡¡Ìáʾ£º <BR>¡¡¡¡1. Ó¢¹úÈËסºìÉ«·¿×Ó <BR>¡¡¡¡2. ÈðµäÈËÑø¹· <BR>¡¡¡¡3. µ¤ÂóÈ˺Ȳè <BR>¡¡¡¡4. ÂÌÉ«·¿×ÓÔÚ°×É«·¿×Ó×óÃæ <BR>¡¡¡¡5. ÂÌÉ«·¿×ÓÖ÷È˺ȿ§·È <BR>¡¡¡¡6. ³épall mall ÏãÑ̵ÄÈËÑøÄñ <BR>¡¡¡¡7. »ÆÉ«·¿×ÓÖ÷È˳édunhill ÏãÑÌ <BR>¡¡¡¡8. סÔÚÖм䷿×ÓµÄÈ˺ÈÅ£ÄÌ <BR>¡¡¡¡9. ŲÍþÈËסµÚÒ»¼ä·¿ <BR>¡¡¡¡10. ³éblendsÏãÑ̵ÄÈËסÔÚÑøÃ¨µÄÈ˸ô±Ú <BR>¡¡¡¡11. ÑøÂíµÄÈËס³édunhill ÏãÑ̵ÄÈ˸ô±Ú <BR>¡¡¡¡12. ³éblue masterµÄÈËºÈÆ¡¾Æ <BR>¡¡¡¡13. µÂ¹úÈ˳éprinceÏãÑÌ <BR>¡¡¡¡14. ŲÍþÈËסÀ¶É«·¿×Ó¸ô±Ú <BR>¡¡¡¡15. ³éblendsÏãÑ̵ÄÈËÓÐÒ»¸öºÈË®µÄÁÚ¾Ó <BR><BR>¡¡¡¡¾Ý˵Êǰ®Òò˹̹Ìá³öµÄÒ»¸öÎÊÌâ¡£ËûÀÏÈ˼ҵÄÍÆÀíÄÜÁ¦ÊµÔÚºÜÀ÷º¦£¬°³ÃÇÆÕͨÈ˾ÍÖ»ºÃÓñ¿·½·¨ÁË¡£ÏÂÃæ¸ø³öÒ»¸öÇî¾Ù·¨µÄ³ÌÐòÀ´¼ÆËã½á¹û <BR><BR>#include "stdafx.h" <BR>#include <CONIO.H><BR><BR>char* color_name[] = <BR>{ <BR>¡¡¡¡"ºì",¡¡¡¡"°×",¡¡¡¡"ÂÌ",¡¡¡¡"À¶",¡¡¡¡"»Æ", <BR>}; <BR>enum <BR>{ <BR>¡¡¡¡e_red, e_white, e_green, e_blue, e_yellow <BR>}; <BR><BR>char* nation_name[] = <BR>{ <BR>¡¡¡¡"Ó¢¹úÈË",¡¡¡¡"ÈðµäÈË",¡¡¡¡"µ¤ÂóÈË",¡¡¡¡"ŲÍþÈË",¡¡¡¡"µÂ¹úÈË", <BR>}; <BR>enum <BR>{ <BR>¡¡¡¡e_briton, e_swede, e_dane, e_norwegian, e_german <BR>}; <BR><BR>char* drink_name[] = <BR>{ <BR>¡¡¡¡"¿§·È",¡¡¡¡"²è",¡¡¡¡"Å£ÄÌ",¡¡¡¡"Æ¡¾Æ",¡¡¡¡"Ë®", <BR>}; <BR>enum <BR>{ <BR>¡¡¡¡e_coffee, e_tea, e_milk, e_beer, e_water <BR>}; <BR><BR>char* smoke_name[] = <BR>{ <BR>¡¡¡¡"pall mall",¡¡¡¡"dunhill",¡¡¡¡"blends",¡¡¡¡"blue master",¡¡¡¡"prince", <BR>}; <BR>enum <BR>{ <BR>¡¡¡¡e_pallmall, e_dunhill, e_blends, e_bluemaster, e_prince <BR>}; <BR><BR>char* pet_name[] = <BR>{ <BR>¡¡¡¡"¹·",¡¡¡¡"è",¡¡¡¡"Äñ",¡¡¡¡"Âí",¡¡¡¡"Óã", <BR>}; <BR>enum <BR>{ <BR>¡¡¡¡e_dog, e_cat, e_bird, e_horse, e_fish <BR>}; <BR><BR>const int house_count = 5; <BR>const int attrib_count = 5; <BR>const int tab_count = 5*4*3*2*1; <BR>char attrib_tab[tab_count][house_count]; <BR>struct house_data <BR>{ <BR>¡¡¡¡union <BR>¡¡¡¡{ <BR>¡¡¡¡¡¡¡¡struct <BR>¡¡¡¡¡¡¡¡{ <BR>¡¡¡¡¡¡¡¡¡¡¡¡int color; <BR>¡¡¡¡¡¡¡¡¡¡¡¡int nation; <BR>¡¡¡¡¡¡¡¡¡¡¡¡int drink; <BR>¡¡¡¡¡¡¡¡¡¡¡¡int smoke; <BR>¡¡¡¡¡¡¡¡¡¡¡¡int pet; <BR>¡¡¡¡¡¡¡¡}; <BR>¡¡¡¡¡¡¡¡int attrib[5]; <BR>¡¡¡¡}; <BR>}house; <BR><BR>void house_confirm() <BR>{ <BR>¡¡¡¡int i; <BR>¡¡¡¡char* tab_color¡¡¡¡ = attrib_tab[house.color]; <BR>¡¡¡¡char* tab_nation¡¡¡¡= attrib_tab[house.nation]; <BR>¡¡¡¡char* tab_drink¡¡¡¡ = attrib_tab[house.drink]; <BR>¡¡¡¡char* tab_smoke¡¡¡¡ = attrib_tab[house.smoke]; <BR>¡¡¡¡char* tab_pet¡¡¡¡¡¡ = attrib_tab[house.pet]; <BR><BR>¡¡¡¡//8. סÔÚÖм䷿×ÓµÄÈ˺ÈÅ£ÄÌ <BR>¡¡¡¡if(tab_drink[2] != e_milk) <BR>¡¡¡¡{ <BR>¡¡¡¡¡¡¡¡return; <BR>¡¡¡¡} <BR>¡¡¡¡for(i = 0; i &lt; house_count; i ++) <BR>¡¡¡¡{ <BR>¡¡¡¡¡¡¡¡// 1. Ó¢¹úÈËסºìÉ«·¿×Ó <BR>¡¡¡¡¡¡¡¡if(tab_nation<I> == e_briton) <BR>¡¡¡¡¡¡¡¡{ <BR>¡¡¡¡¡¡¡¡¡¡¡¡if(tab_color<I> != e_red) <BR>¡¡¡¡¡¡¡¡¡¡¡¡{ <BR>¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡return; <BR>¡¡¡¡¡¡¡¡¡¡¡¡} <BR>¡¡¡¡¡¡¡¡} <BR>¡¡¡¡¡¡¡¡//2. ÈðµäÈËÑø¹· <BR>¡¡¡¡¡¡¡¡else if(tab_nation<I> == e_swede) <BR>¡¡¡¡¡¡¡¡{ <BR>¡¡¡¡¡¡¡¡¡¡¡¡if(tab_pet<I> != e_dog) <BR>¡¡¡¡¡¡¡¡¡¡¡¡{ <BR>¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡return; <BR>¡¡¡¡¡¡¡¡¡¡¡¡} <BR>¡¡¡¡¡¡¡¡} <BR>¡¡¡¡¡¡¡¡//3. µ¤ÂóÈ˺Ȳè <BR>¡¡¡¡¡¡¡¡else if(tab_nation<I> == e_dane) <BR>¡¡¡¡¡¡¡¡{ <BR>¡¡¡¡¡¡¡¡¡¡¡¡if(tab_drink<I> != e_tea) <BR>¡¡¡¡¡¡¡¡¡¡¡¡{ <BR>¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡return; <BR>¡¡¡¡¡¡¡¡¡¡¡¡} <BR>¡¡¡¡¡¡¡¡} <BR>¡¡¡¡¡¡¡¡//9. ŲÍþÈËסµÚÒ»¼ä·¿ <BR>¡¡¡¡¡¡¡¡else if(tab_nation<I> == e_norwegian) <BR>¡¡¡¡¡¡¡¡{ <BR>¡¡¡¡¡¡¡¡¡¡¡¡if(i &gt; 0) <BR>¡¡¡¡¡¡¡¡¡¡¡¡{ <BR>¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡return; <BR>¡¡¡¡¡¡¡¡¡¡¡¡} <BR>¡¡¡¡¡¡¡¡¡¡¡¡//14. ŲÍþÈËסÀ¶É«·¿×Ó¸ô±Ú <BR>¡¡¡¡¡¡¡¡¡¡¡¡if(tab_color[1] != e_blue) <BR>¡¡¡¡¡¡¡¡¡¡¡¡{ <BR>¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡return; <BR>¡¡¡¡¡¡¡¡¡¡¡¡} <BR>¡¡¡¡¡¡¡¡} <BR>¡¡¡¡¡¡¡¡//13. µÂ¹úÈ˳éprinceÏãÑÌ <BR>¡¡¡¡¡¡¡¡else if(tab_nation<I> == e_german) <BR>¡¡¡¡¡¡¡¡{ <BR>¡¡¡¡¡¡¡¡¡¡¡¡if(tab_smoke<I> != e_prince) <BR>¡¡¡¡¡¡¡¡¡¡¡¡{ <BR>¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡return; <BR>¡¡¡¡¡¡¡¡¡¡¡¡} <BR>¡¡¡¡¡¡¡¡} <BR>¡¡¡¡¡¡¡¡//4. ÂÌÉ«·¿×ÓÔÚ°×É«·¿×Ó×óÃæ <BR>¡¡¡¡¡¡¡¡if(tab_color<I> == e_green) <BR>¡¡¡¡¡¡¡¡{ <BR>¡¡¡¡¡¡¡¡¡¡¡¡if(i &gt;= house_count) <BR>¡¡¡¡¡¡¡¡¡¡¡¡{ <BR>¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡return; <BR>¡¡¡¡¡¡¡¡¡¡¡¡} <BR>¡¡¡¡¡¡¡¡¡¡¡¡if(tab_color[i+1] != e_white) <BR>¡¡¡¡¡¡¡¡¡¡¡¡{ <BR>¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡return; <BR>¡¡¡¡¡¡¡¡¡¡¡¡} <BR>¡¡¡¡¡¡¡¡¡¡¡¡//5. ÂÌÉ«·¿×ÓÖ÷È˺ȿ§·È <BR>¡¡¡¡¡¡¡¡¡¡¡¡if(tab_drink<I> != e_coffee) <BR>¡¡¡¡¡¡¡¡¡¡¡¡{ <BR>¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡return; <BR>¡¡¡¡¡¡¡¡¡¡¡¡} <BR>¡¡¡¡¡¡¡¡} <BR>¡¡¡¡¡¡¡¡//6. ³épall mall ÏãÑ̵ÄÈËÑøÄñ <BR>¡¡¡¡¡¡¡¡if(tab_smoke<I> == e_pallmall) <BR>¡¡¡¡¡¡¡¡{ <BR>¡¡¡¡¡¡¡¡¡¡¡¡if(tab_pet<I> != e_bird) <BR>¡¡¡¡¡¡¡¡¡¡¡¡{ <BR>¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡return; <BR>¡¡¡¡¡¡¡¡¡¡¡¡} <BR>¡¡¡¡¡¡¡¡} <BR>¡¡¡¡¡¡¡¡//7. »ÆÉ«·¿×ÓÖ÷È˳édunhill ÏãÑÌ <BR>¡¡¡¡¡¡¡¡if(tab_color<I> == e_yellow) <BR>¡¡¡¡¡¡¡¡{ <BR>¡¡¡¡¡¡¡¡¡¡¡¡if(tab_smoke<I> != e_dunhill) <BR>¡¡¡¡¡¡¡¡¡¡¡¡{ <BR>¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡return; <BR>¡¡¡¡¡¡¡¡¡¡¡¡} <BR>¡¡¡¡¡¡¡¡} <BR>¡¡¡¡¡¡¡¡//10. ³éblendsÏãÑ̵ÄÈËסÔÚÑøÃ¨µÄÈ˸ô±Ú <BR>¡¡¡¡¡¡¡¡//15. ³éblendsÏãÑ̵ÄÈËÓÐÒ»¸öºÈË®µÄÁÚ¾Ó <BR>¡¡¡¡¡¡¡¡if(tab_smoke<I> == e_blends) <BR>¡¡¡¡¡¡¡¡{ <BR>¡¡¡¡¡¡¡¡¡¡¡¡bool bCat = false; <BR>¡¡¡¡¡¡¡¡¡¡¡¡bool bWater = false; <BR>¡¡¡¡¡¡¡¡¡¡¡¡if(i &lt; house_count-1) <BR>¡¡¡¡¡¡¡¡¡¡¡¡{ <BR>¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡if(tab_pet[i+1] == e_cat) <BR>¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡{ <BR>¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡bCat = true; <BR>¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡} <BR>¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡if(tab_drink[i+1] == e_water) <BR>¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡{ <BR>¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡bWater = true; <BR>¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡} <BR>¡¡¡¡¡¡¡¡¡¡¡¡} <BR>¡¡¡¡¡¡¡¡¡¡¡¡if(i &gt; 0) <BR>¡¡¡¡¡¡¡¡¡¡¡¡{ <BR>¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡if(tab_pet[i-1] == e_cat) <BR>¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡{ <BR>¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡bCat = true; <BR>¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡} <BR>¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡if(tab_drink[i-1] == e_water) <BR>¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡{ <BR>¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡bWater = true; <BR>¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡} <BR>¡¡¡¡¡¡¡¡¡¡¡¡} <BR>¡¡¡¡¡¡¡¡¡¡¡¡if(!bCat || !bWater) <BR>¡¡¡¡¡¡¡¡¡¡¡¡{ <BR>¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡return; <BR>¡¡¡¡¡¡¡¡¡¡¡¡} <BR>¡¡¡¡¡¡¡¡} <BR>¡¡¡¡¡¡¡¡//11. ÑøÂíµÄÈËס³édunhill ÏãÑ̵ÄÈ˸ô±Ú <BR>¡¡¡¡¡¡¡¡else if(tab_smoke<I> == e_dunhill) <BR>¡¡¡¡¡¡¡¡{ <BR>¡¡¡¡¡¡¡¡¡¡¡¡bool bHorse = false; <BR>¡¡¡¡¡¡¡¡¡¡¡¡if(i &lt; house_count-1) <BR>¡¡¡¡¡¡¡¡¡¡¡¡{ <BR>¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡if(tab_pet[i+1] == e_horse) <BR>¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡{ <BR>¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡bHorse = true; <BR>¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡} <BR>¡¡¡¡¡¡¡¡¡¡¡¡} <BR>¡¡¡¡¡¡¡¡¡¡¡¡if(i &gt; 0) <BR>¡¡¡¡¡¡¡¡¡¡¡¡{ <BR>¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡if(tab_pet[i-1] == e_horse) <BR>¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡{ <BR>¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡bHorse = true; <BR>¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡} <BR>¡¡¡¡¡¡¡¡¡¡¡¡} <BR>¡¡¡¡¡¡¡¡¡¡¡¡if(!bHorse) <BR>¡¡¡¡¡¡¡¡¡¡¡¡{ <BR>¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡return; <BR>¡¡¡¡¡¡¡¡¡¡¡¡} <BR>¡¡¡¡¡¡¡¡} <BR>¡¡¡¡¡¡¡¡//12. ³éblue masterµÄÈËºÈÆ¡¾Æ <BR>¡¡¡¡¡¡¡¡else if(tab_smoke<I> == e_bluemaster) <BR>¡¡¡¡¡¡¡¡{ <BR>¡¡¡¡¡¡¡¡¡¡¡¡if(tab_drink<I> != e_beer) <BR>¡¡¡¡¡¡¡¡¡¡¡¡{ <BR>¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡return; <BR>¡¡¡¡¡¡¡¡¡¡¡¡} <BR>¡¡¡¡¡¡¡¡} <BR>¡¡¡¡} <BR>¡¡¡¡printf("Find&#92;n"); <BR><BR>¡¡¡¡printf("color&#92;tnation&#92;tdrink&#92;tpet&#92;tsmoke&#92;n"); <BR>¡¡¡¡for(i = 0; i &lt; house_count; i ++) <BR>¡¡¡¡{ <BR>¡¡¡¡¡¡¡¡printf("%s&#92;t%s&#92;t%s&#92;t%s&#92;t%s&#92;n", <BR>¡¡¡¡¡¡¡¡¡¡¡¡color_name[tab_color<I>], <BR>¡¡¡¡¡¡¡¡¡¡¡¡nation_name[tab_nation<I>], <BR>¡¡¡¡¡¡¡¡¡¡¡¡drink_name[tab_drink<I>], <BR>¡¡¡¡¡¡¡¡¡¡¡¡pet_name[tab_pet<I>], <BR>¡¡¡¡¡¡¡¡¡¡¡¡smoke_name[tab_smoke<I>] <BR>¡¡¡¡¡¡¡¡¡¡¡¡); <BR>¡¡¡¡} <BR>¡¡¡¡return; <BR>} <BR><BR>void house_walk(int attrib) <BR>{ <BR>¡¡¡¡int a = attrib + 1; <BR>¡¡¡¡for(int i = 0; i &lt; tab_count; i ++) <BR>¡¡¡¡{ <BR>¡¡¡¡¡¡¡¡house.attrib[attrib] = i; <BR><BR>¡¡¡¡¡¡¡¡switch(attrib) <BR>¡¡¡¡¡¡¡¡{ <BR>¡¡¡¡¡¡¡¡//¡¡¡¡int color; <BR>¡¡¡¡¡¡¡¡case 0: <BR>¡¡¡¡¡¡¡¡¡¡¡¡//14. ŲÍþÈËסÀ¶É«·¿×Ó¸ô±Ú <BR>¡¡¡¡¡¡¡¡¡¡¡¡if(attrib_tab<I>[1] != e_blue) <BR>¡¡¡¡¡¡¡¡¡¡¡¡{ <BR>¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡continue; <BR>¡¡¡¡¡¡¡¡¡¡¡¡} <BR>¡¡¡¡¡¡¡¡¡¡¡¡break; <BR>¡¡¡¡¡¡¡¡//¡¡¡¡int nation; <BR>¡¡¡¡¡¡¡¡case 1: <BR>¡¡¡¡¡¡¡¡¡¡¡¡//9. ŲÍþÈËסµÚÒ»¼ä·¿ <BR>¡¡¡¡¡¡¡¡¡¡¡¡if(attrib_tab<I>[0] != e_norwegian) <BR>¡¡¡¡¡¡¡¡¡¡¡¡{ <BR>¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡continue; <BR>¡¡¡¡¡¡¡¡¡¡¡¡} <BR>¡¡¡¡¡¡¡¡¡¡¡¡break; <BR>¡¡¡¡¡¡¡¡//¡¡¡¡int drink; <BR>¡¡¡¡¡¡¡¡case 2: <BR>¡¡¡¡¡¡¡¡¡¡¡¡//8. סÔÚÖм䷿×ÓµÄÈ˺ÈÅ£ÄÌ <BR>¡¡¡¡¡¡¡¡¡¡¡¡if(attrib_tab<I>[2] != e_milk) <BR>¡¡¡¡¡¡¡¡¡¡¡¡{ <BR>¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡continue; <BR>¡¡¡¡¡¡¡¡¡¡¡¡} <BR>¡¡¡¡¡¡¡¡¡¡¡¡{ <BR>¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡bool bContinue = false; <BR>¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡for(int h = 0; h &lt; house_count; h ++) <BR>¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡{ <BR>¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡if(attrib_tab<I>[h] == e_tea) <BR>¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡{ <BR>¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡if(attrib_tab[house.nation][h] != e_dane) <BR>¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡{ <BR>¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡bContinue = true; <BR>¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡break; <BR>¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡} <BR>¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡} <BR>¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡else if(attrib_tab<I>[h] == e_coffee) <BR>¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡{ <BR>¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡if(attrib_tab[house.color][h] != e_green) <BR>¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡{ <BR>¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡bContinue = true; <BR>¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡break; <BR>¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡} <BR>¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡} <BR>¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡} <BR>¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡if(bContinue) <BR>¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡{ <BR>¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡continue; <BR>¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡} <BR>¡¡¡¡¡¡¡¡¡¡¡¡} <BR>¡¡¡¡¡¡¡¡¡¡¡¡break; <BR>¡¡¡¡¡¡¡¡//¡¡¡¡int smoke; <BR>¡¡¡¡¡¡¡¡case 3: <BR>¡¡¡¡¡¡¡¡¡¡¡¡{ <BR>¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡bool bContinue = false; <BR>¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡for(int h = 0; h &lt; house_count; h ++) <BR>¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡{ <BR>¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡if(attrib_tab<I>[h] == e_dunhill) <BR>¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡{ <BR>¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡if(attrib_tab[house.color][h] != e_yellow) <BR>¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡{ <BR>¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡bContinue = true; <BR>¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡break; <BR>¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡} <BR>¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡} <BR>¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡else if(attrib_tab<I>[h] == e_bluemaster) <BR>¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡{ <BR>¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡if(attrib_tab[house.drink][h] != e_beer) <BR>¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡{ <BR>¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡bContinue = true; <BR>¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡break; <BR>¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡} <BR>¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡} <BR>¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡} <BR>¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡if(bContinue) <BR>¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡{ <BR>¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡continue; <BR>¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡} <BR>¡¡¡¡¡¡¡¡¡¡¡¡} <BR>¡¡¡¡¡¡¡¡¡¡¡¡break; <BR>¡¡¡¡¡¡¡¡//¡¡¡¡int pet; <BR>¡¡¡¡¡¡¡¡} <BR>¡¡¡¡¡¡¡¡ <BR>¡¡¡¡¡¡¡¡if(a &gt;= attrib_count) <BR>¡¡¡¡¡¡¡¡{ <BR>¡¡¡¡¡¡¡¡¡¡¡¡house_confirm(); <BR>¡¡¡¡¡¡¡¡} <BR>¡¡¡¡¡¡¡¡else <BR>¡¡¡¡¡¡¡¡{ <BR>¡¡¡¡¡¡¡¡¡¡¡¡house_walk(attrib+1); <BR>¡¡¡¡¡¡¡¡} <BR>¡¡¡¡} <BR>} <BR><BR>void gen_tab(int h, int&amp; index) <BR>{ <BR>¡¡¡¡int i; <BR>¡¡¡¡for(i = 0; i &lt; house_count; i ++) <BR>¡¡¡¡{ <BR>¡¡¡¡¡¡¡¡int j; <BR>¡¡¡¡¡¡¡¡for(j = 0; j &lt; h; j ++) <BR>¡¡¡¡¡¡¡¡{ <BR>¡¡¡¡¡¡¡¡¡¡¡¡if(i == attrib_tab[index][j]) <BR>¡¡¡¡¡¡¡¡¡¡¡¡{ <BR>¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡goto lable_next; <BR>¡¡¡¡¡¡¡¡¡¡¡¡} <BR>¡¡¡¡¡¡¡¡} <BR>¡¡¡¡¡¡¡¡attrib_tab[index][h]¡¡¡¡= i; <BR>¡¡¡¡¡¡¡¡if(h == house_count-1) <BR>¡¡¡¡¡¡¡¡{ <BR>¡¡¡¡¡¡¡¡¡¡¡¡index ++; <BR>¡¡¡¡¡¡¡¡¡¡¡¡attrib_tab[index][0] = attrib_tab[index-1][0]; <BR>¡¡¡¡¡¡¡¡¡¡¡¡attrib_tab[index][1] = attrib_tab[index-1][1]; <BR>¡¡¡¡¡¡¡¡¡¡¡¡attrib_tab[index][2] = attrib_tab[index-1][2]; <BR>¡¡¡¡¡¡¡¡¡¡¡¡attrib_tab[index][3] = attrib_tab[index-1][3]; <BR>¡¡¡¡¡¡¡¡¡¡¡¡return; <BR>¡¡¡¡¡¡¡¡} <BR>¡¡¡¡¡¡¡¡gen_tab(h+1, index); <BR>lable_next:; <BR>¡¡¡¡} <BR>} <BR><BR>int _tmain(int argc, _TCHAR* argv[]) <BR>{ <BR>¡¡¡¡int index = 0; <BR>¡¡¡¡gen_tab(0, index); <BR>¡¡¡¡house_walk(0); <BR>¡¡¡¡getch(); <BR>¡¡¡¡return 0; <BR>} <BR><BR></SPAN><BR></I></I></I></I></I></I></I></I></I></I></I></I></I></I></I></I></I></I></I></I></I></I></I></I></I></I></I></I></I></I></I>




»¶Ó­¹âÁÙ ÐË»¯400Éú»îÍø (http://wenhui.vc7.cc/) Powered by Discuz! X2.5