• <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中統計keyword的數量,找到最大值并輸出對應的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 閱讀(531) 評論(0)  編輯 收藏 引用 所屬分類: 題目分類:字符串處理
            亚洲国产成人精品无码久久久久久综合| 久久强奷乱码老熟女| 伊人久久大香线蕉亚洲五月天| 欧洲性大片xxxxx久久久| 97久久婷婷五月综合色d啪蜜芽 | 69久久精品无码一区二区| 精品久久久久久无码专区| 99热热久久这里只有精品68| 久久精品夜色噜噜亚洲A∨| 国产成人无码精品久久久性色| 久久久国产精品福利免费 | 国产精品综合久久第一页 | 亚洲精品第一综合99久久| 久久久久免费看成人影片| 国产精品激情综合久久| 久久偷看各类wc女厕嘘嘘| 久久久精品国产Sm最大网站| 久久久精品人妻一区二区三区蜜桃| 亚洲综合精品香蕉久久网97| 国产精品久久久久a影院| 欧美精品一区二区精品久久| 一个色综合久久| 国产亚洲成人久久| 久久婷婷五月综合色奶水99啪| 三级片免费观看久久| 狠狠色丁香久久综合五月| 午夜精品久久久久久99热| 国产精品成人久久久| 久久精品99无色码中文字幕| 亚洲国产精久久久久久久| 91久久婷婷国产综合精品青草| 久久久久久久久久久精品尤物| 久久精品国产一区二区三区不卡| 久久99精品久久久久久hb无码| 久久久久久久精品妇女99| 午夜精品久久久久久| 久久久亚洲精品蜜桃臀| 激情五月综合综合久久69| 久久精品国产亚洲AV不卡| 国产精品青草久久久久福利99 | 国产AV影片久久久久久|