• <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)  編輯 收藏 引用 所屬分類: 題目分類:字符串處理
            国产V综合V亚洲欧美久久| 欧美成人免费观看久久| 精品久久人妻av中文字幕| 国产成人综合久久综合| 久久免费精品视频| 亚洲精品97久久中文字幕无码| 色偷偷88欧美精品久久久| 亚洲色欲久久久综合网东京热| 2021久久精品国产99国产精品| 久久人人爽人人澡人人高潮AV| 国产毛片欧美毛片久久久| 国产激情久久久久影院老熟女免费 | 2021精品国产综合久久| 亚洲欧美成人久久综合中文网| 蜜臀久久99精品久久久久久小说 | 中文精品久久久久人妻| 久久亚洲国产精品一区二区| 色婷婷综合久久久久中文字幕| 成人免费网站久久久| 三级三级久久三级久久| 热久久这里只有精品| 无码专区久久综合久中文字幕| 亚洲欧美国产精品专区久久 | 久久精品草草草| 婷婷久久久亚洲欧洲日产国码AV| 久久久久久国产精品免费免费| 欧美伊香蕉久久综合类网站| 精品久久久久久亚洲精品 | 久久夜色精品国产| 久久r热这里有精品视频| 久久亚洲精品国产精品| 欧美精品久久久久久久自慰| 久久久亚洲AV波多野结衣| 久久只这里是精品66| 三级片免费观看久久| 思思久久好好热精品国产| 亚洲国产精品无码久久青草| 久久亚洲精品无码播放| 国产精品99久久久久久宅男小说| 亚洲国产精品嫩草影院久久| 欧美国产成人久久精品|