在线看毛片网站电影-亚洲国产欧美日韩精品一区二区三区,国产欧美乱夫不卡无乱码,国产精品欧美久久久天天影视,精品一区二区三区视频在线观看,亚洲国产精品人成乱码天天看,日韩久久久一区,91精品国产91免费

<menu id="6qfwx"><li id="6qfwx"></li></menu>
    1. <menu id="6qfwx"><dl id="6qfwx"></dl></menu>

      <label id="6qfwx"><ol id="6qfwx"></ol></label><menu id="6qfwx"></menu><object id="6qfwx"><strike id="6qfwx"><noscript id="6qfwx"></noscript></strike></object>
        1. <center id="6qfwx"><dl id="6qfwx"></dl></center>

            新聞中心

            回溯法解題序

            作者: 時間:2016-12-01 來源:網(wǎng)絡 收藏
            #include "stdafx.h"

            #include "回溯推理.h"

            本文引用地址:http://www.biyoush.com/article/201612/324287.htm

            //組合元素名稱
            char *YS[]={NULL,"紅色","黃色","綠色","藍色","白色"};
            char *GJ[]={NULL,"挪威人","英國人","德國人","丹麥人","瑞典人"};
            char *CW[]={NULL,"養(yǎng)狗","養(yǎng)貓","養(yǎng)魚","養(yǎng)鳥","養(yǎng)馬"};
            char *YL[]={NULL,"喝 茶","喝牛奶","喝咖啡","喝啤酒","喝 水"};
            char *YP[]={NULL,"抽Blends煙","抽BlueMaster煙","抽Dunhill煙","抽PallMall煙","抽Prince煙"};


            TuiLi::TuiLi()
            {
            //初始化房子數(shù)組
            int x;
            for(x=0;x<5;x++)
            {
            Fz[x].ys=0;
            Fz[x].gj=0;
            Fz[x].cw=0;
            Fz[x].yl=0;
            Fz[x].yp=0;
            }

            }

            TuiLi::~TuiLi()
            {
            }

            void TuiLi::init_biao() //初始組合表
            {
            //組合標志
            int a,b,c,d,e;
            int x;
            int i=0;
            //生成一張12345的數(shù)字組合表
            for (x=12345;x<=54321;x++)
            {
            e = x % 10;
            d = x / 10 % 10;
            c = x / 100 % 10;
            b = x / 1000 % 10;
            a = x / 10000 % 10;
            if (a != b && a != c && a != d && a != e && b != c && b != d && b != e
            && c != d && c != e && d != e && a > 0 && a < 6 && b > 0 && b < 6
            && c > 0 && c < 6 && d > 0 && d < 6 && e > 0 && e < 6)
            {
            Biao[i][0]=a;
            Biao[i][1]=b;
            Biao[i][2]=c;
            Biao[i][3]=d;
            Biao[i][4]=e;
            }
            }
            }

            void TuiLi::print() //屏幕輸出推理結果
            {
            GetLocalTime(&TIME);//獲得系統(tǒng)當前時間
            printf("推理結果獲取時間為:%d年%d月%d日%d時%d分%d秒",TIME.wYear,TIME.wMonth,TIME.wDay,TIME.wHour,TIME.wMinute,TIME.wSecond);
            printf("%s %s %s %s %s",YS[Fz[0].ys],GJ[Fz[0].gj],CW[Fz[0].cw],YL[Fz[0].yl],YP[Fz[0].yp]);
            printf("%s %s %s %s %s",YS[Fz[1].ys],GJ[Fz[1].gj],CW[Fz[1].cw],YL[Fz[1].yl],YP[Fz[1].yp]);
            printf("%s %s %s %s %s",YS[Fz[2].ys],GJ[Fz[2].gj],CW[Fz[2].cw],YL[Fz[2].yl],YP[Fz[2].yp]);
            printf("%s %s %s %s %s",YS[Fz[3].ys],GJ[Fz[3].gj],CW[Fz[3].cw],YL[Fz[3].yl],YP[Fz[3].yp]);
            printf("%s %s %s %s %s",YS[Fz[4].ys],GJ[Fz[4].gj],CW[Fz[4].cw],YL[Fz[4].yl],YP[Fz[4].yp]);
            }
            void TuiLi::gx()
            {
            int x;
            int z=0;
            for(x=0;x<5;x++)
            {
            Fz[x].ys=sz[z];
            z++;
            }
            for(x=0;x<5;x++)
            {
            Fz[x].gj=sz[z];
            z++;
            }
            for(x=0;x<5;x++)
            {
            Fz[x].cw=sz[z];
            z++;
            }
            for(x=0;x<5;x++)
            {
            Fz[x].yl=sz[z];
            z++;
            }
            for(x=0;x<5;x++)
            {
            Fz[x].yp=sz[z];
            z++;
            }

            }

            參考http://www.51hei.com/mcu/2640.html

            和http://www.51hei.com/mcu/2641.html



            關鍵詞: 回溯法解題

            評論


            技術專區(qū)

            關閉