• <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ù)量,找到最大值并輸出對應(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 閱讀(536) 評論(0)  編輯 收藏 引用 所屬分類: 題目分類:字符串處理
            久久伊人亚洲AV无码网站| 一级a性色生活片久久无少妇一级婬片免费放 | 久久国产精品二国产精品| 99久久无色码中文字幕| 久久精品亚洲精品国产色婷| 久久亚洲AV成人无码电影| 久久99热只有频精品8| 国产精品毛片久久久久久久| 久久香蕉国产线看观看99| 99久久国产主播综合精品 | 久久精品国产亚洲AV蜜臀色欲| 久久久噜噜噜久久中文字幕色伊伊| 久久精品亚洲AV久久久无码| 狠狠色综合网站久久久久久久高清| 亚洲午夜久久久影院| 久久精品国产精品青草| 久久国产乱子伦精品免费午夜| 久久综合五月丁香久久激情| 久久久国产99久久国产一| 亚洲精品蜜桃久久久久久| 久久亚洲高清观看| 婷婷久久精品国产| 久久久久99精品成人片试看| 品成人欧美大片久久国产欧美| 亚洲性久久久影院| 国产欧美久久久精品| 久久久久噜噜噜亚洲熟女综合| 亚洲精品乱码久久久久久| 久久精品人人做人人爽电影| 欧美久久久久久| 久久精品中文字幕久久| 精品久久久无码21p发布 | 东方aⅴ免费观看久久av | 国产2021久久精品| 中文无码久久精品| 久久精品国产清自在天天线| 99久久99久久精品国产片果冻| 久久狠狠一本精品综合网| 99re久久精品国产首页2020| 久久精品国产2020| 久久精品亚洲欧美日韩久久|