• <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)  編輯 收藏 引用 所屬分類: 題目分類:字符串處理題目分類:排序
            久久久无码一区二区三区| 精品久久久久久综合日本| 亚洲а∨天堂久久精品9966| 国产精品中文久久久久久久| 色诱久久久久综合网ywww| 久久精品国产精品亚洲精品| 久久人人超碰精品CAOPOREN| 老色鬼久久亚洲AV综合| 久久精品中文字幕第23页| 波多野结衣AV无码久久一区| 国产99久久久久久免费看| 久久久国产视频| 国产成人无码精品久久久久免费| 伊人久久大香线蕉精品不卡| 精品无码久久久久国产| 麻豆久久| 欧美精品一区二区精品久久| 午夜精品久久久久久毛片| 久久精品国产WWW456C0M| 国产亚洲精品自在久久| 亚洲国产精品无码成人片久久| 久久久久女教师免费一区| 狠狠色丁香久久婷婷综| 一本一本久久a久久综合精品蜜桃| 久久国产精品免费| 国产精品久久久久久久午夜片| 久久久久久精品免费免费自慰| 久久综合九色欧美综合狠狠 | 色婷婷综合久久久久中文 | 久久亚洲中文字幕精品有坂深雪| 久久婷婷五月综合成人D啪| 久久久久久亚洲精品无码| 国产精品99久久久久久董美香| 97久久精品午夜一区二区| 国产午夜福利精品久久2021| 嫩草伊人久久精品少妇AV| 精品一二三区久久aaa片| 人妻少妇久久中文字幕 | 国产69精品久久久久777| 久久久久无码精品国产不卡| 99久久夜色精品国产网站|