• <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 閱讀(556) 評論(0)  編輯 收藏 引用 所屬分類: 題目分類:字符串處理題目分類:排序
            久久久久99精品成人片| 热99re久久国超精品首页| 国内精品九九久久精品| 久久综合狠狠综合久久| 久久久久久亚洲精品不卡| 国产精品久久久久a影院| 免费精品99久久国产综合精品| 亚洲一区二区三区日本久久九| 亚洲人成网站999久久久综合| 久久综合九色综合97_久久久| 久久婷婷人人澡人人| 精品国产VA久久久久久久冰| 久久亚洲国产精品五月天婷| 久久九九有精品国产23百花影院| 97精品依人久久久大香线蕉97| 久久996热精品xxxx| 91精品日韩人妻无码久久不卡| 久久综合九色综合网站| 亚洲婷婷国产精品电影人久久 | 久久99精品国产自在现线小黄鸭| 欧美亚洲国产精品久久| 久久久久九国产精品| 国产成人精品久久一区二区三区av| 精品国产99久久久久久麻豆| 日韩美女18网站久久精品| 国产视频久久| 国内精品久久久久久中文字幕| 婷婷久久综合九色综合98| 久久国产精品久久国产精品| www久久久天天com| 99久久精品日本一区二区免费| 久久精品国产亚洲av水果派 | 亚洲美日韩Av中文字幕无码久久久妻妇| 久久国产乱子精品免费女| 久久se精品一区精品二区| 99久久综合狠狠综合久久止| AV狠狠色丁香婷婷综合久久| 久久久青草青青亚洲国产免观| 日本道色综合久久影院| 久久天天日天天操综合伊人av| 久久只有这精品99|