• <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)  編輯 收藏 引用 所屬分類: 題目分類:字符串處理
            91精品国产综合久久久久久 | 伊人久久大香线蕉综合热线| 久久青青草原国产精品免费| 7国产欧美日韩综合天堂中文久久久久| 97久久综合精品久久久综合| 久久99精品久久久久久秒播| 久久久久亚洲av成人网人人软件| 久久久久久综合网天天| 色综合久久最新中文字幕| 久久久久久综合网天天| 国产成人久久777777| 男女久久久国产一区二区三区| 久久九九久精品国产| 粉嫩小泬无遮挡久久久久久| 久久只这里是精品66| 国产午夜电影久久| 精品久久久久久久久午夜福利| 手机看片久久高清国产日韩| 久久综合久久综合久久| 精品无码久久久久久午夜| 超级97碰碰碰碰久久久久最新| 观看 国产综合久久久久鬼色 欧美 亚洲 一区二区 | 日产精品久久久久久久| 亚洲人成电影网站久久| 久久精品这里只有精99品| 久久久九九有精品国产| 久久精品国产亚洲AV香蕉| 亚洲日韩中文无码久久| 久久久久国产精品嫩草影院| 伊人久久大香线蕉综合5g| 久久精品国产福利国产琪琪| 国产成人精品久久一区二区三区av| 精品熟女少妇a∨免费久久| 久久婷婷五月综合色奶水99啪| 99久久精品国产一区二区| 一本久道久久综合狠狠爱| 亚洲av成人无码久久精品| 久久婷婷国产剧情内射白浆| 2021久久精品免费观看| 亚洲精品乱码久久久久久按摩 | 久久精品国产亚洲AV嫖农村妇女|