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

            哇哦~這就是我

            This is my way ~
            <2025年6月>
            25262728293031
            1234567
            891011121314
            15161718192021
            22232425262728
            293012345

            統計

            • 隨筆 - 10
            • 文章 - 0
            • 評論 - 2
            • 引用 - 0

            常用鏈接

            留言簿(1)

            隨筆檔案

            搜索

            •  

            最新評論

            閱讀排行榜

            評論排行榜

            C++第五次上機作業

             

            #include<iostream>
            #include
            <sstream>
            #include
            <map>
            #include
            <string>
            #include
            <vector>
            #include
            <iomanip>
            #include
            <fstream>
            using namespace std;
            typedef map
            < string , vector<int> > WORD;
            void init ( WORD 
            & m )
            {
             ifstream fin;
             fin.open(
            "keywords.txt");
                
            string keyword;
                
            while ( fin>>keyword )
                    m[keyword];
             fin.close();
            }
            void count ( WORD 
            & m )
            {
                
            int line=0;
             ifstream fin;
             fin.open(
            "text.txt");
                
            string str;
                
            while ( getline(fin,str) )
                {
                    stringstream SS(str);
                    line
            ++;
                    
            while(SS>>str)
                    {
                        
            if ( m.find(str)!=m.end() )
                            m[str].push_back (line);
                    }
                }
             fin.close();
            }
            void output ( WORD m )
            {
                
            string keyword;
                
            for ( WORD::iterator iter_map=m.begin() ; iter_map!=m.end() ; iter_map++ )
                {
                    cout
            <<setw(10)<<iter_map->first<<":"
                        
            <<"(";
                    
            for ( vector<int>::iterator iter_vector=iter_map->second.begin() ; iter_vector!=iter_map->second.end(); iter_vector++ )
                    {
                        
            if ( iter_vector!=iter_map->second.begin() )
                            cout
            <<",";
                        cout
            <<*iter_vector;
                    }
                    cout
            <<")"<<endl;
                }
            }
            int main  ()
            {
                WORD m;
                init(m);
                count(m);
                output(m);
            }

            posted on 2008-04-03 23:10 chinaeli 閱讀(325) 評論(1)  編輯 收藏 引用

            評論

            # re: C++第五次上機作業 2008-04-05 23:15 一個你的同學

            你似乎還是不會使用批處理文件和命令行參數喲~~
              回復  更多評論    
            久久免费99精品国产自在现线| 久久精品中文闷骚内射| 综合久久给合久久狠狠狠97色| 久久人人青草97香蕉| 久久久久人妻精品一区| 久久99久久成人免费播放| 久久这里只有精品首页| www.久久热.com| 国产亚洲美女精品久久久2020| 精品久久久久久亚洲| 久久九九兔免费精品6| 久久九九久精品国产免费直播| 国产成人久久AV免费| 欧美精品丝袜久久久中文字幕| 久久久久久午夜成人影院| 久久国产成人| 品成人欧美大片久久国产欧美...| 亚洲综合伊人久久综合| 午夜福利91久久福利| 久久国产免费直播| 香港aa三级久久三级| 久久国产色AV免费看| 亚洲精品乱码久久久久久久久久久久 | 久久久久国产精品麻豆AR影院| 久久婷婷五月综合97色| 亚洲第一永久AV网站久久精品男人的天堂AV | 久久久噜噜噜久久中文字幕色伊伊| 亚洲AV无码一区东京热久久| 2021最新久久久视精品爱| 人妻无码久久精品| 亚洲欧美精品一区久久中文字幕| 国产成人精品久久亚洲| 国产高清国内精品福利99久久| 久久免费线看线看| 久久精品国产精品国产精品污| 精品久久久久久国产91| 久久中文字幕一区二区| 久久99亚洲综合精品首页| 久久精品国产福利国产琪琪| 亚洲国产成人精品女人久久久| 久久久久久免费视频|