• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            華劍緣
            一切都在這個過程中獲得,將那些目標(biāo)埋藏于心中
            posts - 19,comments - 20,trackbacks - 0


            幻方:

            #include? " iostream.h "

            int ?main()
            {
            ????????
            int ?N,i,j,count;
            ????????cout
            << " Please?enter?N: " ;
            ????????cin
            >> N;
            ????????
            int ? ** arr = new ? int * ?[N];
            ????????
            for (i = 0 ;i < N;i ++ )
            ????????????????arr[i]
            = new ? int [N];
            ????????
            for (i = 0 ;i < N;i ++ )
            ????????????????
            for (j = 0 ;j < N;j ++ )
            ????????????????????????arr[i][j]
            = 0 ;
            ????????arr[
            0 ][(N + 1 ) / 2 - 1 ] = 1 ;
            ????????
            for (count = 1 ,i = 0 ,j = (N + 1 ) / 2 - 1 ;count < N * N;count ++ )
            ????????
            {
            ????????????????i
            -- ;
            ????????????????j
            -- ;
            ????????????????
            if (i ==- 1 )
            ????????????????????????i
            = N - 1 ;
            ????????????????
            if (j ==- 1 )
            ????????????????????????j
            = N - 1 ;
            ????????????????
            if (arr[i][j] == 0 )
            ????????????????????????arr[i][j]
            = count + 1 ;
            ????????????????
            else ? if (arr[i][j] > 0 )
            ????????????????
            {
            ????????????????????????i
            = i + 2 ;
            ????????????????????????j
            = j + 1 ;
            ????????????????????????
            if (j == N)
            ????????????????????????????????j
            = 0 ;
            ????????????????????????
            if (i == N)
            ????????????????????????????????i
            = 0 ;
            ????????????????????????
            else ? if (i == N + 1 )
            ????????????????????????????????i
            = 1 ;
            ????????????????????????arr[i][j]
            = count + 1 ;
            ????????????????}

            ????????}

            ????????
            for (i = 0 ;i < N;i ++ )
            ????????
            {
            ????????????????
            for (j = 0 ;j < N;j ++ )
            ????????????????
            {
            ????????????????????????cout
            << arr[i][j] << " ? " ;
            ????????????????}

            ????????????????cout
            << " \n " ;
            ????????}

            ?????????????????????
            for (i = 0 ;i < N;i ++ )
            ????????????????delete?[]?arr[i];
            ????????delete?[]?arr;
            ????????
            return ? 1 ;
            }
            posted on 2006-04-09 22:58 華劍緣 閱讀(499) 評論(3)  編輯 收藏 引用

            FeedBack:
            # re: 幻方,呵呵學(xué)習(xí)學(xué)習(xí)
            2006-04-10 09:03 | 沐楓
            int ** arr = new int * [N];
            for (i = 0 ;i < N;i ++ )
            arr[i] = new int [N];
            for (i = 0 ;i < N;i ++ )
            for (j = 0 ;j < N;j ++ )
            arr[i][j] = 0 ;

            好可怕的數(shù)據(jù)結(jié)構(gòu)和初始化!!!  回復(fù)  更多評論
              
            # re: 幻方,呵呵學(xué)習(xí)學(xué)習(xí)
            2006-04-10 12:27 | 華劍緣
            呵呵,我是新手請指教。幫改改好么,不勝感激。  回復(fù)  更多評論
              
            # re: 幻方,呵呵學(xué)習(xí)學(xué)習(xí)
            2006-04-14 17:31 | 華劍緣
            @沐楓
            @沐楓
            c:\documents and settings\kakaxi\桌面\新建文件夾\text1.cpp(12) : error C2065: 'for_each' : undeclared identifier
            c:\documents and settings\kakaxi\桌面\新建文件夾\text1.cpp(12) : error C2065: 'bind2nd' : undeclared identifier
            c:\documents and settings\kakaxi\桌面\新建文件夾\text1.cpp(12) : error C2065: 'mem_fun_ref' : undeclared identifier  回復(fù)  更多評論
              

            只有注冊用戶登錄后才能發(fā)表評論。
            網(wǎng)站導(dǎo)航: 博客園   IT新聞   BlogJava   博問   Chat2DB   管理


            久久国产欧美日韩精品| 久久久WWW成人免费精品| 亚洲国产另类久久久精品黑人 | 欧美精品福利视频一区二区三区久久久精品 | 国产成人无码精品久久久久免费 | 久久精品国产亚洲精品2020| 狠狠色婷婷久久一区二区三区| 久久精品国产秦先生| 伊人久久大香线蕉综合网站| 精品少妇人妻av无码久久| 欧洲性大片xxxxx久久久| 久久久亚洲欧洲日产国码二区| 久久免费大片| 91精品国产乱码久久久久久 | 国产综合精品久久亚洲| 久久综合久久自在自线精品自| 国产精自产拍久久久久久蜜| 一本久道久久综合狠狠爱| 久久99国产一区二区三区| 99久久免费国产特黄| 精品无码久久久久国产动漫3d| 久久久久久久综合日本| 国产精品熟女福利久久AV | 久久久久久久久66精品片| 久久97精品久久久久久久不卡 | 国产免费久久精品丫丫| 看久久久久久a级毛片| 伊人久久大香线蕉av不变影院| 日本国产精品久久| 久久久久亚洲?V成人无码| 久久精品国产亚洲7777| 91精品国产91热久久久久福利| 久久婷婷五月综合97色| 久久AV高清无码| 国产精品美女久久久久网| 精品国产VA久久久久久久冰| aaa级精品久久久国产片| 久久777国产线看观看精品| 久久国产精品99久久久久久老狼 | 婷婷久久综合| 7777久久久国产精品消防器材|