• <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>
            心如止水
            Je n'ai pas le temps
            posts - 400,comments - 130,trackbacks - 0
            從excuse中統(tǒng)計(jì)keyword的數(shù)量,找到最大值并輸出對(duì)應(yīng)的excuse。
            以下是我的代碼:
            #include<iostream>
            #include
            <string>
            #include
            <set>
            #include
            <cstdio>
            #include
            <cctype>
            using namespace std;
            const int kMaxm(27);

            struct Excuse
            {
                Excuse():counter(
            0) {}
                
            string words;
                
            int counter;
            };

            int main()
            {
                
            /*
                freopen("data.in","r",stdin);
                freopen("data.out","w",stdout);
                //
            */

                
            int T(0),n,m;
                
            while(cin>>n>>m)
                {
                    
            set<string> keywords;
                    
            for(int i=1;i<=n;i++)
                    {
                        
            string t;
                        cin
            >>t;
                        keywords.insert(t);
                    }
                    getchar();
                    Excuse r[kMaxm];
                    
            for(int i=1;i<=m;i++)
                    {
                        getline(cin,r[i].words);
                        
            string t(r[i].words);
                        
            for(int j=0;j<t.size();j++)
                            t[j]
            =tolower(t[j]);
                        
            for(int j=0;j<t.size();j++)
                        {
                            
            string t2;
                            
            while(isalpha(t[j]))
                            {
                                t2
            +=t[j];
                                j
            ++;
                            }
                            
            if(keywords.count(t2))
                                r[i].counter
            ++;
                        }
                    }
                    
            int max_ans(0);
                    
            for(int i=1;i<=m;i++)
                        
            if(max_ans<r[i].counter)
                            max_ans
            =r[i].counter;
                    T
            ++;
                    cout
            <<"Excuse Set #"<<T<<endl;
                    
            for(int i=1;i<=m;i++)
                        
            if(r[i].counter==max_ans)
                            cout
            <<r[i].words<<endl;
                    cout
            <<endl;
                }

                
            return 0;
            }
            posted on 2011-04-07 12:50 lee1r 閱讀(533) 評(píng)論(0)  編輯 收藏 引用 所屬分類: 題目分類:字符串處理
            久久大香香蕉国产| 欧美色综合久久久久久| 久久精品免费观看| 久久久久久极精品久久久| 波多野结衣久久一区二区| 国产人久久人人人人爽| 久久er国产精品免费观看8| 综合久久国产九一剧情麻豆| 国产99精品久久| 亚洲va久久久噜噜噜久久狠狠| 久久综合中文字幕| 77777亚洲午夜久久多喷| 久久精品国产99久久香蕉| 久久精品蜜芽亚洲国产AV| 亚洲欧美久久久久9999| 国产视频久久| 成人国内精品久久久久影院| 伊人久久大香线蕉亚洲五月天| 久久WWW免费人成—看片| 国内精品久久久久久99蜜桃| 亚洲国产视频久久| 久久婷婷色综合一区二区| 香港aa三级久久三级| 国产69精品久久久久777| 国产成人精品综合久久久久| 热RE99久久精品国产66热| 久久成人精品| 久久se精品一区精品二区国产| 人人狠狠综合久久亚洲婷婷| 国产成人精品久久二区二区| 2021少妇久久久久久久久久| 国内精品久久久久伊人av| 久久婷婷五月综合97色| 亚洲精品乱码久久久久久蜜桃图片| 天天做夜夜做久久做狠狠| 欧美日韩中文字幕久久久不卡| 久久婷婷人人澡人人| 久久福利资源国产精品999| 97香蕉久久夜色精品国产 | 99久久99久久精品国产| 久久精品国产99国产精品澳门|