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

            統(tǒng)計(jì)

            • 隨筆 - 10
            • 文章 - 0
            • 評(píng)論 - 2
            • 引用 - 0

            常用鏈接

            留言簿(1)

            隨筆檔案

            搜索

            •  

            最新評(píng)論

            閱讀排行榜

            評(píng)論排行榜

            C++第五次上機(jī)作業(yè)

             

            #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) 評(píng)論(1)  編輯 收藏 引用

            評(píng)論

            # re: C++第五次上機(jī)作業(yè) 2008-04-05 23:15 一個(gè)你的同學(xué)

            你似乎還是不會(huì)使用批處理文件和命令行參數(shù)喲~~

            只有注冊(cè)用戶登錄后才能發(fā)表評(píng)論。
            網(wǎng)站導(dǎo)航: 博客園   IT新聞   BlogJava   博問(wèn)   Chat2DB   管理


            国产毛片久久久久久国产毛片 | 中文字幕久久欲求不满| 久久狠狠高潮亚洲精品| 精品亚洲综合久久中文字幕| 18岁日韩内射颜射午夜久久成人| 久久91这里精品国产2020| 久久婷婷国产剧情内射白浆| 久久精品99久久香蕉国产色戒| 一本伊大人香蕉久久网手机| 亚洲国产成人精品女人久久久 | 久久综合成人网| 亚洲va久久久噜噜噜久久男同| 久久se精品一区二区| 久久天天躁狠狠躁夜夜2020一| 亚洲精品高清久久| 亚洲综合久久久| 久久久精品日本一区二区三区| 久久婷婷激情综合色综合俺也去| 精品熟女少妇aⅴ免费久久| 久久久久久九九99精品| 一级做a爰片久久毛片看看 | 国产精品欧美久久久天天影视| 婷婷久久综合| 久久精品中文字幕有码| AV无码久久久久不卡蜜桃| 久久久久亚洲AV无码专区首JN | 亚洲人成网亚洲欧洲无码久久| 成人亚洲欧美久久久久| 久久国产精品无码一区二区三区 | 性做久久久久久久久| 色综合久久88色综合天天| 久久精品国产精品亚洲精品| 天堂无码久久综合东京热| 久久免费大片| 久久伊人五月天论坛| 久久伊人中文无码| 久久一区二区三区免费| 66精品综合久久久久久久| 国产99久久久国产精免费| 国产亚洲欧美成人久久片| 久久国产精品一区二区|