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

            The Fourth Dimension Space

            枯葉北風寒,忽然年以殘,念往昔,語默心酸。二十光陰無一物,韶光賤,寐難安; 不畏形影單,道途阻且慢,哪曲折,如渡飛湍。斬浪劈波酬壯志,同把酒,共言歡! -如夢令

            已知先序+中序遍歷求后序遍歷(模板類)

             

            #include<iostream>
            #include
            <string>
            #include
            <algorithm>
            using namespace std;
            //////////////////////////////////////////////////////////////////////////////////////////
            ///                                    Pre_in_to_pos class
            ///        此類封裝了能夠?qū)涞南刃虮闅v和中序遍歷轉(zhuǎn)化成后序遍歷的操作(AC北大pku2255)
            ///                                                    -By abilitytao
            ///                                                            2009年5月24日
            //////////////////////BEGIN_TEMPLATE_BY_ABILITYTAO_ACM/////////////////////////////////////

            class Pre_in_to_pos
            {

            private:
                
            string pre;
                
            string in;
                
            string post;
                
            void trans(string a,string b);
            public:
                Pre_in_to_pos()
                
            {

                    pre.erase();
                    
            in.erase();
                    post.erase();
                }

                
            int inputpre();
                
            int inputpre(string a)
                
            {

                    pre
            =a;
                    
            return 1;
                }

                
            int inputin();
                
            int inputin(string a)
                
            {

                    
            in=a;
                    
            return 1;
                }


                
            void trans();
                
            void output();
                
            void clear();
            }
            ;

            int Pre_in_to_pos::inputpre()
            {

                cin
            >>pre;
                
            return 1;
            }


            int Pre_in_to_pos::inputin()
            {

                cin
            >>in;
                
            return 1;
            }


            void Pre_in_to_pos::trans(string a,string b)
            {

                
            int k=a.find(b.substr(0,1));
                
            if(k>0)
                    trans(a.substr(
            0,k),b.substr(1,k));
                
            if(k<a.length()-1)
                    trans(a.substr(k
            +1,a.length()-1-k),b.substr(k+1,b.length()-1-k));
                post
            +=a[k];
            }


            void Pre_in_to_pos::trans()
            {
                post.erase();
                trans(
            in,pre);
            }


            void Pre_in_to_pos::output()
            {

                cout
            <<post;
            }
            //沒有預置回車;


            /////////////////////END_TEMPLATE_BY_ABILITYTAO_ACM/////////////////////////////





            int main()
            {

                Pre_in_to_pos test;
                
            string pre;
                
            string in;
                
            while(cin>>pre>>in)
                
            {
                    test.inputpre(pre);
                    test.inputin(
            in);
                    test.trans();
                    test.output();
                    cout
            <<endl;
                }

                
            return 0;
            }

            posted on 2009-05-24 01:41 abilitytao 閱讀(335) 評論(0)  編輯 收藏 引用

            久久久久久久97| 久久精品国产99国产精品澳门| 一级a性色生活片久久无少妇一级婬片免费放 | 亚洲乱码精品久久久久..| 久久久国产精华液| 伊人久久综合成人网| 久久亚洲国产中v天仙www | 久久久这里有精品| 亚洲国产精品久久久久婷婷老年 | 久久久久久久久无码精品亚洲日韩 | 久久这里只有精品久久| 精品多毛少妇人妻AV免费久久 | 久久精品中文字幕第23页| 少妇久久久久久久久久| 久久久久噜噜噜亚洲熟女综合| 久久综合狠狠综合久久综合88| 国产精品美女久久久免费| 国产成人精品免费久久久久| 色综合久久天天综线观看| 99久久精品无码一区二区毛片| 色偷偷88888欧美精品久久久| 久久久国产精品| 大香网伊人久久综合网2020| 久久99热只有频精品8| 久久久久高潮综合影院| 日日狠狠久久偷偷色综合96蜜桃 | 精品综合久久久久久97超人| 看久久久久久a级毛片| 久久免费视频1| 国产精品99久久久久久宅男小说| 久久精品成人欧美大片| 97热久久免费频精品99| 久久久久亚洲av无码专区喷水| 久久夜色精品国产噜噜亚洲a| 天天影视色香欲综合久久| 很黄很污的网站久久mimi色| 婷婷综合久久中文字幕| 久久青青草原精品影院| 99久久综合狠狠综合久久| 青青草原综合久久大伊人精品| 久久亚洲国产精品一区二区|