• <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
            注意輸出空格時不能使用ends,否則會WA。就在我對這題感到無比絕望的時候,把ends改成" ",AC。
            用map<string,int>很輕松就可以完成該題。
            以下是我的代碼:
            #include<iostream>
            #include
            <string>
            #include
            <map>
            #include
            <algorithm>
            #include
            <cstdio>
            #include
            <cctype>
            using namespace std;
            const char kTable[]="2223334445556667777888999";

            int main()
            {
                
            /*
                freopen("data.in","r",stdin);
                freopen("data.out","w",stdout);
                //
            */

                
            int T;
                cin
            >>T;
                
            bool first_output(true);
                
            while(T--)
                {
                    
            int n;
                    cin
            >>n;
                    map
            <string,int> r;
                    
            for(int i=1;i<=n;i++)
                    {
                        
            string t;
                        cin
            >>t;
                        t.erase(remove(t.begin(),t.end(),
            '-'),t.end());
                        
            for(int j=0;j<t.size();j++)
                            
            if(!isdigit(t[j]))
                                t[j]
            =kTable[t[j]-'A'];
                        t.insert(
            3,"-");
                        r[t]
            ++;
                    }
                    
            if(first_output)
                        first_output
            =false;
                    
            else
                        cout
            <<endl;
                    
            bool found(false);
                    
            for(map<string,int>::iterator i=r.begin();i!=r.end();i++)
                        
            if(i->second>1)
                        {
                            cout
            <<i->first<<" "<<i->second<<endl;
                            found
            =true;
                        }
                    
            if(!found)
                        cout
            <<"No duplicates."<<endl;
                }

                
            return 0;
            }
            posted on 2011-04-11 23:53 lee1r 閱讀(543) 評論(0)  編輯 收藏 引用 所屬分類: 題目分類:字符串處理題目分類:排序
            久久久久亚洲AV无码专区首JN| 久久se精品一区精品二区| 久久亚洲欧洲国产综合| 久久久久亚洲AV无码专区首JN| 漂亮人妻被黑人久久精品| 国产精品久久久久天天影视| 伊人久久综合热线大杳蕉下载| 亚洲精品国精品久久99热| 新狼窝色AV性久久久久久| 精品多毛少妇人妻AV免费久久| 久久伊人五月丁香狠狠色| 久久精品国产精品亚洲精品| 理论片午午伦夜理片久久 | 国产AV影片久久久久久| 久久久久99精品成人片| 久久亚洲精品国产精品| 欧美亚洲另类久久综合婷婷 | 国产精品熟女福利久久AV| 2020久久精品亚洲热综合一本| 久久精品国产只有精品2020| 香港aa三级久久三级老师2021国产三级精品三级在 | 99re久久精品国产首页2020| 无夜精品久久久久久| 国产三级精品久久| 久久精品国产秦先生| 精品久久久久久久无码| 久久久久久综合网天天| 四虎国产精品成人免费久久| 久久国产午夜精品一区二区三区| 国产成人精品久久二区二区| 亚洲国产精品一区二区久久hs | 99久久国产宗和精品1上映 | 久久丝袜精品中文字幕| 久久国产乱子伦精品免费强| 久久精品国产网红主播| 国产高潮国产高潮久久久| 久久久国产乱子伦精品作者| A级毛片无码久久精品免费| 久久妇女高潮几次MBA| 亚洲精品乱码久久久久久自慰| 久久久久se色偷偷亚洲精品av|