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


            欧美va久久久噜噜噜久久| 国产成人精品久久二区二区| 大香伊人久久精品一区二区| 精品国产乱码久久久久久呢| 97热久久免费频精品99| 久久久久97国产精华液好用吗| 久久精品国产日本波多野结衣| 国产91色综合久久免费| 久久午夜免费视频| 久久精品国产99国产精品澳门 | 精品久久久久久亚洲精品 | 久久久国产乱子伦精品作者| 欧美日韩精品久久久免费观看| 国产综合久久久久久鬼色| 精品久久久一二三区| 精品久久久久久国产三级| 久久精品亚洲一区二区三区浴池 | 国产免费久久精品99re丫y| 国产精品久久永久免费| 久久综合综合久久综合| 久久久国产视频| 伊人久久大香线蕉综合5g| 久久综合久久伊人| 国产高清美女一级a毛片久久w | 久久久久亚洲AV无码永不| 思思久久99热只有频精品66| 亚洲国产成人久久综合野外| 国产巨作麻豆欧美亚洲综合久久| 国产精品久久久久影视不卡| 色综合久久综合中文综合网| 久久久久久午夜成人影院| 亚洲愉拍99热成人精品热久久| 久久久一本精品99久久精品88| 亚洲国产成人精品久久久国产成人一区二区三区综 | 久久激情五月丁香伊人| 久久精品99无色码中文字幕| 久久久99精品成人片中文字幕| 久久久久九九精品影院| 一本久久综合亚洲鲁鲁五月天亚洲欧美一区二区 | 色综合久久夜色精品国产| 亚洲精品无码久久久久|