• <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)  編輯 收藏 引用 所屬分類: 題目分類:字符串處理題目分類:排序
            久久se精品一区二区| 亚洲精品成人网久久久久久| 久久国产精品99久久久久久老狼| 97久久超碰国产精品2021| 久久99精品久久久久久不卡| 亚洲色婷婷综合久久| 亚洲国产精品一区二区久久| 久久无码AV中文出轨人妻| 精品久久无码中文字幕| 亚洲精品成人久久久| 久久精品免费观看| 伊人久久综合精品无码AV专区| 亚洲欧美精品伊人久久| 色婷婷综合久久久中文字幕 | 久久精品中文字幕一区| 欧洲成人午夜精品无码区久久| 久久综合九色综合欧美狠狠| 99久久无色码中文字幕人妻| 久久久精品国产亚洲成人满18免费网站 | 久久精品国产亚洲5555| 国产精品免费看久久久| 狠狠色丁香久久婷婷综合| 婷婷久久综合| 久久综合亚洲色HEZYO国产| 99久久婷婷国产一区二区| 久久国产热精品波多野结衣AV| 久久无码国产专区精品| 久久久精品无码专区不卡| 亚洲成人精品久久| 国内精品久久久久久久久| 精品午夜久久福利大片| 久久国产精品-久久精品| 99久久99这里只有免费费精品| 国内高清久久久久久| 久久午夜福利无码1000合集| 少妇无套内谢久久久久| 久久婷婷午色综合夜啪| 伊人色综合久久天天人手人婷| 亚洲综合伊人久久综合| 久久夜色精品国产噜噜亚洲AV| 777午夜精品久久av蜜臀|