• <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++博客 :: 首頁 :: 聯系 :: 聚合  :: 管理
              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 閱讀(227) 評論(2)  編輯 收藏 引用

            Feedback

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

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

            精品多毛少妇人妻AV免费久久| 久久综合精品国产一区二区三区| 久久精品久久久久观看99水蜜桃 | 久久久99精品成人片中文字幕| 国产精品99久久不卡| 伊人久久大香线蕉精品不卡 | 久久久久国色AV免费看图片| 欧美与黑人午夜性猛交久久久| 亚洲成色www久久网站夜月| 狠狠色丁香婷婷综合久久来| 久久亚洲精品无码观看不卡| AV狠狠色丁香婷婷综合久久| 久久精品九九亚洲精品| 久久精品国产一区二区电影| 亚洲日韩中文无码久久| 无码乱码观看精品久久| 熟妇人妻久久中文字幕| 久久亚洲天堂| 国产一久久香蕉国产线看观看| yy6080久久| 人妻无码久久精品| 精品久久久久中文字| avtt天堂网久久精品| 久久精品一本到99热免费| 品成人欧美大片久久国产欧美...| 漂亮人妻被黑人久久精品| 久久亚洲高清综合| 91久久成人免费| 九九久久99综合一区二区| 久久久久久国产精品免费无码| 超级碰碰碰碰97久久久久| 亚洲精品视频久久久| 久久精品视屏| 香蕉久久永久视频| 无码人妻少妇久久中文字幕 | 久久亚洲精品中文字幕三区| 国内精品久久久久久99蜜桃| 精品无码久久久久久尤物| 久久久精品人妻一区二区三区蜜桃| 免费无码国产欧美久久18| 色综合久久无码五十路人妻|