• <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激情久久无码天堂| 无码专区久久综合久中文字幕| 国产精品美女久久久久久2018| 久久99久久99小草精品免视看| 久久不见久久见免费影院www日本| 久久一本综合| 久久精品成人免费看| 久久精品国产一区二区| 久久久久国产精品| 色欲综合久久躁天天躁蜜桃| 国产69精品久久久久777| 亚洲综合伊人久久大杳蕉| 久久久久无码中| 国产午夜福利精品久久2021 | 免费久久人人爽人人爽av| 狠狠色丁香婷综合久久| 亚洲性久久久影院| 久久丝袜精品中文字幕| 人妻少妇久久中文字幕| 久久久久亚洲av成人网人人软件| 丁香五月综合久久激情| 国产2021久久精品| 狠狠色丁香久久婷婷综合五月| 一本色道久久综合| 国产一区二区久久久| 国产99久久久国产精免费| 久久狠狠高潮亚洲精品| 99久久成人国产精品免费| 亚洲欧美一区二区三区久久| 国产精品美女久久久久AV福利| 国产午夜精品久久久久免费视| 国色天香久久久久久久小说| 狠狠色丁香久久婷婷综合蜜芽五月| 国产免费福利体检区久久| 久久久久久免费一区二区三区| 久久精品人人做人人爽97| 成人综合伊人五月婷久久| 久久精品无码专区免费东京热| 久久精品国产99久久久| 蜜臀av性久久久久蜜臀aⅴ| 久久影院综合精品|