• <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>
              C++博客 :: 首頁 :: 新隨筆 ::  ::  :: 管理

            pku1051

            Posted on 2010-08-19 01:45 Kevin_Zhang 閱讀(170) 評(píng)論(0)  編輯 收藏 引用 所屬分類: 模擬

             

            #include "iostream"

            #include 
            "string"

            #include 
            "ctype.h"

            #include 
            "algorithm"

            #include 
            "Map"

            using namespace std;

            char a[34][9]={".-","-","-.-.","-..",".","..-.","--.",".","..",".---","-.-",".-..",

            "--","-.","---",".--.","--.-",".-.","","-","..-","-",".--","-..-","-.--","--..","..--",".-.-","---.","----"}
            ;

            int b[34]={2,4,4,3,1,4,3,4,2,4,3,4,2,2,3,4,4,3,3,1,3,4,3,4,4,4,4,4,4,4};

            int main()

             

            {

              
            int m,n;

              
            int i;

              
            int count=0;

             

              
            int num[800],num2[800];

              
            char word[1900];

              
            char ch;

              map
            <stringchar> mapcode;

              
            for(i=0;i<26;i++)

              
            {

                  ch
            ='A'+i;

                     mapcode.insert(pair
            <stringchar>(a[i],ch));

              }


              ch
            ='_';

              mapcode.insert(pair
            <stringchar>(a[26],ch));

              ch
            =',';

              mapcode.insert(pair
            <stringchar>(a[27],ch));

                ch
            ='.';

              mapcode.insert(pair
            <stringchar>(a[28],ch));

                ch
            ='?';

              mapcode.insert(pair
            <stringchar>(a[29],ch));

              
            int nSize = mapcode.size();

              
            /*for(i= 0,ch='A'; i < nSize; i++)

              {

                       cout<<mapcode[a[i]]<<" "<<a[i]<<" "<<b[i]<<endl;

              }
            */


              cin
            >>n;

              

              getchar();

              
            while(n--)

              
            {

                     count
            ++;

              i
            =0;

              memset(num,
            0,sizeof(num));

              memset(num2,
            0,sizeof(num2));

              
            string temp("");

              
            while(1)

              
            {

                    

                     ch
            =getchar();

                     
            if(ch=='\n')  break;

                    

                      
            if(ch=='_')

                     
            {

                            temp
            =temp+a[26];

                            num[i]
            =b[26];

                     }


                      
            else  if(ch==',')

                     
            {

                            temp
            =temp+a[27];

                            num[i]
            =b[27];

                     }


                       
            else  if(ch=='.')

                     
            {

                            temp
            =temp+a[28];

                            num[i]
            =b[28];

                     }


                           
            else  if(ch=='?')

                     
            {

                            temp
            =temp+a[29];

                            num[i]
            =b[29];

                     }


                          
            else  if(isalpha(ch))

                     
            {temp=temp+a[ch-'A'];

                  num[i]
            =b[ch-'A'];}


                     i
            ++;

              }


              
            int len=i-1;

              
            for(i=0;i<=len;i++)

              
            {

                     num2[i]
            =num[len-i];

              }


             
            // cout<<num2<<endl;

              
            //cout<<temp<<endl;

              
            int k=0;

              cout
            <<count<<"";

                
            for(i= 0;i<=len; i++)

              
            {

                       cout
            <<mapcode[temp.substr(k,num2[i])];

                             k
            =k+num2[i];

              }


                   cout
            <<endl;

              }


             

            }


            只有注冊(cè)用戶登錄后才能發(fā)表評(píng)論。
            相關(guān)文章:
            網(wǎng)站導(dǎo)航: 博客園   IT新聞   BlogJava   博問   Chat2DB   管理


            久久久久久精品无码人妻| 国产精品美女久久久久久2018| 久久亚洲私人国产精品| 亚洲国产天堂久久久久久| 久久本道综合久久伊人| 一本一道久久精品综合| 91久久精品国产91性色也| 一本大道久久a久久精品综合| 久久精品麻豆日日躁夜夜躁| 久久天天躁狠狠躁夜夜躁2014| 久久99九九国产免费看小说| 一本色道久久综合狠狠躁篇| 久久99热这里只有精品66| 伊人久久大香线蕉综合网站| 久久婷婷国产剧情内射白浆| 亚洲精品无码久久千人斩| 久久精品无码一区二区无码| 九九99精品久久久久久| 很黄很污的网站久久mimi色| 久久91这里精品国产2020| 中文字幕精品无码久久久久久3D日动漫| 欧美国产成人久久精品| 久久久亚洲欧洲日产国码二区| 国产午夜精品久久久久免费视| 777久久精品一区二区三区无码| 国内精品伊人久久久久影院对白| 久久涩综合| 日韩精品久久无码中文字幕| 亚洲国产精品久久久久婷婷软件| 四虎影视久久久免费观看| 亚洲精品午夜国产VA久久成人| 久久久久久综合一区中文字幕| 久久精品国产亚洲Aⅴ香蕉| 77777亚洲午夜久久多人| 国产伊人久久| 人妻精品久久久久中文字幕69 | 亚洲中文字幕无码久久2020| 久久这里只有精品久久| 久久精品国产亚洲AV久| 99久久国产主播综合精品| 无码人妻久久一区二区三区|