• <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年4月>
            303112345
            6789101112
            13141516171819
            20212223242526
            27282930123
            45678910

            統計

            • 隨筆 - 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 閱讀(336) 評論(1)  編輯 收藏 引用

            評論

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

            你似乎還是不會使用批處理文件和命令行參數喲~~
              回復  更多評論    
            久久精品国产日本波多野结衣| 午夜精品久久久久久久| 久久精品国产国产精品四凭| 色天使久久综合网天天 | 蜜桃麻豆www久久国产精品| 久久亚洲精品无码aⅴ大香| 91精品国产乱码久久久久久| 亚洲AⅤ优女AV综合久久久| 欧美牲交A欧牲交aⅴ久久| 国产精品成人99久久久久| 久久天天躁狠狠躁夜夜网站 | 久久99国产综合精品| 国产精品美女久久久免费| 亚洲色婷婷综合久久| 久久久久国产日韩精品网站| 国产成人无码久久久精品一| 亚洲精品无码久久毛片| 国产视频久久| 香蕉久久夜色精品国产小说| 久久久久久久亚洲Av无码| 久久午夜无码鲁丝片秋霞| 久久精品成人免费观看97| 久久国产精品99久久久久久老狼 | 99久久人人爽亚洲精品美女| 亚洲AV无一区二区三区久久 | 精品综合久久久久久88小说| 久久99毛片免费观看不卡| 人妻精品久久无码区| 精品久久亚洲中文无码| 国内精品伊人久久久久777| 伊人久久大香线蕉AV一区二区| 国产—久久香蕉国产线看观看 | 亚洲综合久久综合激情久久| 久久er热视频在这里精品| 99久久精品影院老鸭窝| 97久久精品国产精品青草| 久久99亚洲网美利坚合众国| 久久久久久人妻无码| 久久青青草原国产精品免费 | 丰满少妇人妻久久久久久| 国产一级做a爰片久久毛片|