• <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)  編輯 收藏 引用 所屬分類: 題目分類:字符串處理
            久久久久久精品免费免费自慰| 国产精品美女久久久久| 国产一区二区精品久久| 性色欲网站人妻丰满中文久久不卡| 久久国产热这里只有精品| 国产精品亚洲美女久久久| 老司机国内精品久久久久| 亚洲精品高清久久| 国产精品久久久久影视不卡| 韩国三级大全久久网站| 久久综合欧美成人| 久久久WWW成人| 久久综合久久综合亚洲| 久久天天躁夜夜躁狠狠躁2022| 国产成人久久精品一区二区三区| 久久久久亚洲AV无码观看| 亚洲精品无码久久久影院相关影片| 伊人久久大香线蕉AV色婷婷色| 久久久久久亚洲AV无码专区| 久久中文娱乐网| 思思久久99热免费精品6| 99久久精品免费看国产一区二区三区 | 午夜人妻久久久久久久久| 国产A三级久久精品| 久久大香香蕉国产| 久久av免费天堂小草播放| 久久精品亚洲AV久久久无码| 99久久婷婷国产综合亚洲| 久久精品国产亚洲7777| 亚洲国产精品成人久久| 久久精品国产91久久麻豆自制 | 波多野结衣久久一区二区| 欧美黑人又粗又大久久久 | 一级做a爱片久久毛片| 国产成人综合久久精品红| 久久国产精品无码一区二区三区 | 久久精品国产精品亚洲精品| 欧美久久一区二区三区| 久久久精品国产sm调教网站| 亚洲国产精品无码久久九九| 99久久精品毛片免费播放|