• <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)  編輯 收藏 引用 所屬分類: 題目分類:字符串處理
            久久精品国产只有精品2020| 久久午夜羞羞影院免费观看| 国产高清国内精品福利99久久| 青草影院天堂男人久久| 久久久久久久综合日本| 久久精品视频一| 久久精品国产精品亚洲精品| 亚洲欧美国产日韩综合久久| 久久99国内精品自在现线| 国产高清国内精品福利99久久| 久久99久国产麻精品66| 亚洲天堂久久精品| 亚洲午夜久久久影院| 久久99国产精品成人欧美| 亚洲精品午夜国产VA久久成人| 成人精品一区二区久久久| 无码人妻少妇久久中文字幕蜜桃| 久久99精品久久久久久水蜜桃 | 精品无码久久久久国产动漫3d| 国内精品伊人久久久久| 国产精品亚洲综合久久| 久久久久国产一区二区| 久久99精品国产| 久久99精品国产自在现线小黄鸭| 99久久香蕉国产线看观香| 91超碰碰碰碰久久久久久综合| 色婷婷综合久久久久中文一区二区 | 国产精品内射久久久久欢欢| 国产综合久久久久久鬼色| 久久AV无码精品人妻糸列| 狠狠色丁香婷婷久久综合五月| 久久国产福利免费| 国产精品激情综合久久| segui久久国产精品| 婷婷综合久久狠狠色99h| 久久国产精品99久久久久久老狼| 国内精品久久久久久99| 国产精品欧美久久久久天天影视| 国产 亚洲 欧美 另类 久久 | 午夜不卡久久精品无码免费| 亚洲欧美成人综合久久久|