• <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)  編輯 收藏 引用 所屬分類: 題目分類:字符串處理題目分類:排序
            亚洲综合伊人久久综合| 岛国搬运www久久| 中文字幕久久久久人妻| 国产精品久久久久jk制服| 国内精品久久久久久99| 久久久精品国产亚洲成人满18免费网站| 久久成人永久免费播放| 亚洲va久久久噜噜噜久久男同| 久久精品人人做人人爽电影| 日本久久中文字幕| 国产精品久久久久影视不卡| 精品久久久一二三区| 欧美伊香蕉久久综合类网站| 亚洲精品国产第一综合99久久| 久久精品国产亚洲网站| 国产成人久久精品一区二区三区 | 俺来也俺去啦久久综合网| 国产99久久九九精品无码| 亚洲va久久久噜噜噜久久天堂| 久久精品成人免费观看97| 久久精品天天中文字幕人妻| 久久只这里是精品66| 国产91久久综合| 91精品日韩人妻无码久久不卡| 久久精品国产亚洲AV香蕉| 久久亚洲中文字幕精品一区四| 国内精品久久久久影院一蜜桃| 一日本道伊人久久综合影| 久久国产精品无码网站| 久久香蕉国产线看观看99| 国产精品美女久久久| AV无码久久久久不卡网站下载 | 久久久久成人精品无码 | 久久久久青草线蕉综合超碰| 久久久国产99久久国产一| 伊人色综合九久久天天蜜桃| 久久久久人妻精品一区三寸蜜桃| 91精品国产高清久久久久久国产嫩草 | 亚洲欧美日韩中文久久| A级毛片无码久久精品免费| 免费精品久久天干天干|