• <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 一個你的同學

            你似乎還是不會使用批處理文件和命令行參數喲~~
              回復  更多評論    
            性欧美大战久久久久久久久| 久久久久国产一级毛片高清板| 久久国产免费| 久久人人爽人人爽人人片AV不| 2020国产成人久久精品| 无码人妻久久一区二区三区蜜桃 | 天天久久狠狠色综合| 国产精品无码久久综合网| 久久国产亚洲精品| 国产精品久久成人影院| 亚洲欧美成人久久综合中文网| 久久精品国产免费观看| 中文字幕亚洲综合久久| 久久人人添人人爽添人人片牛牛| 久久精品国产99国产电影网 | 国产午夜久久影院| 国产成人综合久久精品红| 91精品无码久久久久久五月天| 久久亚洲精品无码VA大香大香| 久久97精品久久久久久久不卡| 亚洲精品无码久久毛片| 久久r热这里有精品视频| 久久一区二区三区99| 久久精品国产影库免费看| 久久精品国产精品亚洲精品| 国产亚洲欧美成人久久片| 久久综合九色综合网站| 久久亚洲国产精品123区| 精品久久人人妻人人做精品| 精品无码久久久久久午夜| 伊人久久无码中文字幕| 日韩久久无码免费毛片软件| 亚洲国产精品久久久久婷婷老年| 国产V综合V亚洲欧美久久 | 国产精品久久国产精品99盘| 伊人久久久AV老熟妇色| 久久成人小视频| 久久婷婷国产剧情内射白浆| 成人综合久久精品色婷婷| 久久久国产精华液| 亚洲欧美成人综合久久久|