• <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>

            3D FPS

            1234567890

              C++博客 :: 首頁 :: 聯(lián)系 :: 聚合  :: 管理
              57 Posts :: 2 Stories :: 57 Comments :: 0 Trackbacks

            常用鏈接

            留言簿(10)

            我參與的團隊

            搜索

            •  

            最新評論

            閱讀排行榜

            評論排行榜

            放些代碼上來 懶得打字:
            因為這個東西 有些很不爽

            #include <stdio.h>
            #include <vector>
            #include <algorithm>
            #include <functional>
            //#include "DKcommit.hpp"
            template<class T>
            struct printT
            {    // functor for operator>
                void operator()(const T& _t) const
                {   
                    printf("%d ",_t);
                    //return true;
                }
            };
            #define UseThisFile
            #ifdef UseThisFile

            #define iPageItemCount 15

            int PageConcontArray[iPageItemCount];

            void GiveSpecDateAtPage(std::vector<int> &vecAllDate, int ipage,int *pIntArray)
            {
                std::vector<int>::iterator it;
                 if (vecAllDate.size() == 0)
                 {
                       return ;
                 }
                if (vecAllDate.size() > (ipage + 1) * iPageItemCount )
                 {
                      for (it = vecAllDate.begin() + ipage * iPageItemCount ; it != vecAllDate.begin() + (ipage + 1) * iPageItemCount ;it++)
                      {
                             *pIntArray = *it;
                             pIntArray ++;
                      }
                 }
                 else if (vecAllDate.size() < (ipage +1 ) * iPageItemCount
                             && vecAllDate.size() > (ipage) * iPageItemCount )
                 {
                     for (it = vecAllDate.begin() + ipage * iPageItemCount ; it != vecAllDate.end() ;it++)
                     {
                         *pIntArray = *it;
                         pIntArray ++;
                     }
                 }
            }
            //iPageItemCount



            void GivedDescDateAtPage(std::vector<int> &vecAllDate, int ipage,int *pIntArray)
            {
                std::vector<int>::iterator it;
               

                //int iPageCount = vecAllDate.size() / iPageItemCount;
               
                if (vecAllDate.size() == 0)
                {
                    return ;
                }
                if (vecAllDate.size() > (ipage + 1) * iPageItemCount )
                {
                    for (it = vecAllDate.end() -1 - (ipage ) * iPageItemCount ; it != vecAllDate.end() - 1  - (ipage +1 ) * iPageItemCount ;it--)
                    {
                        *pIntArray = *it;
                        pIntArray ++;
                    }
                }
                else if (vecAllDate.size() <= (ipage +1 ) * iPageItemCount
                    && vecAllDate.size() > (ipage) * iPageItemCount )
                {
                    //int icount;
                    //for (icount = vecAllDate[vecAllDate.size() - vecAllDate.size() % iPageItemCount  - ipage * iPageItemCount] ; icount >= 0  ;icount--)
                    //%for (it = vecAllDate.begin(); it != vecAllDate.end() /* - 1*/- ipage * iPageItemCount  ;it++)
                    for ( it = vecAllDate.end()  - 1- ipage * iPageItemCount  ;it != vecAllDate.begin()  ;it--)
                    {
                        //*pIntArray = *(&vecAllDate[icount]);
                        *pIntArray = *it;
                        pIntArray ++;
                    }
                    *pIntArray =  *(&vecAllDate[0]);
                }
            }


            void main()
            {
                printf("helloWorld\n");

                std::vector<int> a;
                for (int i = 1; i < 11; i ++)
                {
                    a.push_back(i);
                }

                std::for_each(a.begin(),a.end(),printT<int>() );

                printf("\n");

                std::for_each(PageConcontArray,PageConcontArray+10,printT<int>());
                printf("\n");
               

                for (int iPage = 0 ;iPage <= 19;iPage ++)
                {
                    printf("This is %d page  :",iPage);
                    int a1 = ARRAY_SIZE(PageConcontArray);
                    int b2 = sizeof(PageConcontArray)/sizeof(PageConcontArray[0]);
              
                    for (int i = 0; i < iPageItemCount ;i++)
                    {
                        PageConcontArray[i] = 0;
                    }
               
                   //std::for_each(PageConcontArray,PageConcontArray+iPageItemCount,printT<int>());
                   GiveSpecDateAtPage(a,iPage,PageConcontArray);
                   std::for_each(PageConcontArray,PageConcontArray+iPageItemCount,printT<int>());
                   printf("\n");
                }


                for (int iPage = 0 ;iPage <= 19;iPage ++)
                {
                    printf("This is %d page  :",iPage);
                    int a1 = ARRAY_SIZE(PageConcontArray);
                    int b2 = sizeof(PageConcontArray)/sizeof(PageConcontArray[0]);

                    for (int i = 0; i < iPageItemCount ;i++)
                    {
                        //printf("FFF< %d > sdf",i);
                        PageConcontArray[i] = 0;
                    }


                    //std::for_each(PageConcontArray,PageConcontArray+iPageItemCount,printT<int>());
                    GivedDescDateAtPage(a,iPage,PageConcontArray);
                    std::for_each(PageConcontArray,PageConcontArray+iPageItemCount,printT<int>());
                    printf("\n");
                }




                //std::for_each(PageConcontArray,PageConcontArray+10,printT<int>());

                printf("\n");
                //printf("\n");


               

                getchar();
            }


            #endif




            posted on 2009-02-08 03:17 DK_jims 閱讀(225) 評論(2)  編輯 收藏 引用

            Feedback

            # re: 分頁 2009-02-08 03:26 DK_jims
            在那一個地方 少了一個等號呀   回復(fù)  更多評論
              

            # re: 分頁 2009-02-08 21:37 DK_jims
            發(fā)覺自己太無知了 這樣容易 錯誤多多 的程序 是自己寫的呀 太屎了  回復(fù)  更多評論
              


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


            亚洲国产精品无码成人片久久| 精品国产一区二区三区久久蜜臀| 天天做夜夜做久久做狠狠| 亚洲а∨天堂久久精品| 久久婷婷成人综合色综合| 97久久国产亚洲精品超碰热| 久久精品成人欧美大片| 亚洲va久久久噜噜噜久久狠狠| 青青草国产精品久久久久| 久久人人爽人人爽人人片av麻烦| 狠狠色丁香婷综合久久| 狠狠色婷婷久久综合频道日韩 | 久久夜色精品国产亚洲| 久久99精品久久久久久动态图| 久久精品成人欧美大片| 久久99国产亚洲高清观看首页| 亚洲国产成人精品91久久久| 伊人久久大香线焦综合四虎| 99久久精品免费看国产一区二区三区 | 久久99精品久久久久婷婷| 一本一道久久a久久精品综合| 色综合久久中文色婷婷| 久久精品国产99久久无毒不卡| 久久影院午夜理论片无码| a级毛片无码兔费真人久久| 国内精品久久久久久99| 色欲久久久天天天综合网 | 久久男人AV资源网站| 国产A级毛片久久久精品毛片| 精品久久久久久无码专区| 日本五月天婷久久网站| 欧美一区二区久久精品| 久久国产亚洲精品| 波多野结衣久久精品| 久久精品国产久精国产一老狼| 国内精品久久久久久不卡影院| 很黄很污的网站久久mimi色 | 99久久婷婷国产综合精品草原| 99久久精品毛片免费播放| 久久婷婷激情综合色综合俺也去| 久久久久亚洲精品天堂|