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

            評論

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

            你似乎還是不會使用批處理文件和命令行參數喲~~
              回復  更多評論    
            国产高潮久久免费观看| 亚洲综合熟女久久久30p| 久久综合狠狠综合久久激情 | 青青国产成人久久91网| 久久精品99无色码中文字幕| 综合久久精品色| 69国产成人综合久久精品| 久久久久人妻精品一区三寸蜜桃| 国产亚洲精久久久久久无码77777| 69久久夜色精品国产69| 无码国内精品久久综合88 | 久久久久久亚洲精品不卡| 婷婷五月深深久久精品| 亚洲乱码日产精品a级毛片久久| 亚洲人成网亚洲欧洲无码久久 | 久久久老熟女一区二区三区| 久久精品国产亚洲精品| 久久精品九九亚洲精品| 国产一区二区久久久| 久久se精品一区二区影院| www.久久热| 狠狠色婷婷久久综合频道日韩| 精品久久久久久无码人妻热| 国产欧美久久一区二区| 久久天天躁狠狠躁夜夜网站| 一级做a爰片久久毛片免费陪| 国内精品久久久久久久久电影网| 99精品国产在热久久| 色综合久久久久综合体桃花网| 午夜精品久久久久久久无码| 久久久久婷婷| 久久亚洲国产成人精品无码区| 99久久精品免费看国产| 狠狠精品干练久久久无码中文字幕| 精品综合久久久久久97超人| 国内精品久久久人妻中文字幕| 无码精品久久久久久人妻中字| 久久天天躁狠狠躁夜夜avapp| 久久亚洲美女精品国产精品| 新狼窝色AV性久久久久久| 一本色道久久99一综合|