• <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 ~
            <2008年5月>
            27282930123
            45678910
            11121314151617
            18192021222324
            25262728293031
            1234567

            統計

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

            你似乎還是不會使用批處理文件和命令行參數喲~~
              回復  更多評論    
            精品伊人久久大线蕉色首页| 国产L精品国产亚洲区久久 | 九九久久自然熟的香蕉图片| 97久久国产综合精品女不卡 | 久久91精品久久91综合| 久久99精品久久久久久秒播| 2021国内精品久久久久久影院| 一本一本久久A久久综合精品| 狠狠干狠狠久久| 久久亚洲天堂| 国产成人精品白浆久久69| 欧美麻豆久久久久久中文| 国产∨亚洲V天堂无码久久久| 97久久精品人人澡人人爽| 久久精品国产亚洲AV影院| 久久精品国产亚洲精品| 久久精品aⅴ无码中文字字幕不卡 久久精品aⅴ无码中文字字幕重口 | 无码日韩人妻精品久久蜜桃| 国产精品久久久久久久午夜片| 伊人久久大香线蕉综合Av| 久久久久久国产精品无码下载| 久久久久久夜精品精品免费啦| 香蕉久久夜色精品国产2020| 国产精品xxxx国产喷水亚洲国产精品无码久久一区 | 久久人人妻人人爽人人爽| 欧美精品丝袜久久久中文字幕| www性久久久com| 色综合久久综合中文综合网| 中文成人无码精品久久久不卡| 99久久精品九九亚洲精品| 国产午夜免费高清久久影院| 18岁日韩内射颜射午夜久久成人 | 久久综合丁香激情久久| 久久ww精品w免费人成| 久久婷婷国产剧情内射白浆| 亚洲国产精品成人久久蜜臀| 久久精品国产国产精品四凭| 精品国产综合区久久久久久| 亚洲国产天堂久久综合网站| 国产无套内射久久久国产| 国产精品欧美亚洲韩国日本久久|