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

            我參與的團(tuán)隊

            搜索

            •  

            最新評論

            閱讀排行榜

            評論排行榜

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

            #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 閱讀(233) 評論(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   管理


            欧美噜噜久久久XXX| 天天综合久久一二三区| 青青草原1769久久免费播放| 91久久精品91久久性色| 久久国产成人午夜AV影院| 久久人人爽人人爽人人片AV东京热 | 狠狠色狠狠色综合久久| 国产精品女同久久久久电影院| 品成人欧美大片久久国产欧美... 品成人欧美大片久久国产欧美 | 午夜精品久久久久久中宇| 久久香蕉综合色一综合色88| 久久久久亚洲AV无码专区首JN| 99久久99久久精品国产片果冻| 国产A三级久久精品| 久久精品国产清自在天天线| 久久久中文字幕| 久久婷婷五月综合色高清| 久久婷婷五月综合国产尤物app| 久久亚洲高清观看| 97久久久精品综合88久久| 久久久亚洲裙底偷窥综合| 一级做a爰片久久毛片毛片| 91久久精品视频| 国产高潮国产高潮久久久91 | 国产精品欧美久久久久天天影视 | 久久99久久成人免费播放| 99久久成人国产精品免费| 无码国内精品久久人妻| 99久久99久久精品国产片果冻| 婷婷国产天堂久久综合五月| 精品久久久久一区二区三区| 国产激情久久久久影院| 99久久精品费精品国产| 国产成人无码精品久久久免费 | 精品一二三区久久aaa片| 人人妻久久人人澡人人爽人人精品| 亚洲欧美成人久久综合中文网 | 亚洲欧洲精品成人久久奇米网| 亚洲国产精品综合久久网络| 久久久久久久久久久精品尤物| 亚洲AV无码久久精品成人|