• <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>

            T9的空間

            You will never walk alone!

              C++博客 :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理 ::
              69 隨筆 :: 0 文章 :: 28 評論 :: 0 Trackbacks
            這里有對全排列函數permutation的介紹http://hi.baidu.com/sunshine_0316/blog/item/6f87a044bf30f320cffca381.html
            #include<iostream>
            #include
            <map>
            #include
            <algorithm>

            using namespace std;

            typedef 
            struct node
            {
                
            char ch;
                
            int flag;
            }
            node;

            bool cmp(const node a,const node b)
            {
                
            return a.flag<b.flag;
            }


            int main()
            {
                
            int cas,i;
                
            char str[15],ch;
                map
            <char,int> mp;
                
            for(ch='A',i=1;ch<='Z';ch++,i=i+2) mp[ch]=i;
                
            for(ch='a',i=2;ch<='z';ch++,i=i+2) mp[ch]=i;
                scanf(
            "%d",&cas);
                
            while(cas--)
                
            {
                    scanf(
            "%s",str);
                    
            int len=strlen(str);
                    node p[
            15];
                    
            for(i=0;i<len;i++)
                    
            {
                        p[i].ch
            =str[i];
                        p[i].flag
            =mp[str[i]];
                    }

                    sort(p,p
            +len,cmp);
                    
            do
                    
            {
                        
            for(i=0;i<len;i++)
                            printf(
            "%c",p[i].ch);
                        printf(
            "\n");
                    }
            while(next_permutation(p,p+len,cmp));
                }

                
            return 0;
            }


            posted on 2008-09-10 11:32 Torres 閱讀(1006) 評論(0)  編輯 收藏 引用 所屬分類: Number Theory
            人人狠狠综合久久亚洲婷婷| 日本精品久久久久中文字幕| 久久精品无码午夜福利理论片| 性做久久久久久久| 嫩草影院久久99| 伊人久久无码精品中文字幕| 国产精品美女久久久久网| 开心久久婷婷综合中文字幕| 99久久精品影院老鸭窝| 久久婷婷色香五月综合激情| 中文字幕成人精品久久不卡| 性欧美丰满熟妇XXXX性久久久 | 伊人久久大香线蕉综合影院首页| 精品少妇人妻av无码久久| 午夜精品久久久内射近拍高清| www.久久热.com| 久久男人Av资源网站无码软件 | 久久免费精品视频| 久久亚洲国产成人精品性色| 久久人人爽人人爽人人片AV麻烦| 青青青青久久精品国产| 国内精品久久人妻互换| 777午夜精品久久av蜜臀| 久久久久久久久66精品片| 国产精品99久久不卡| 精品免费tv久久久久久久| 久久婷婷五月综合色奶水99啪| 国产69精品久久久久9999APGF| 久久99九九国产免费看小说| 亚洲精品99久久久久中文字幕| 99久久精品免费| 久久99精品久久久久久野外| 亚洲一本综合久久| 狠狠综合久久综合中文88| 久久久久亚洲AV无码专区桃色| 亚洲天堂久久精品| 欧美日韩精品久久久久| 精品久久久久久无码不卡| 麻豆成人久久精品二区三区免费| 色综合久久久久无码专区 | 久久久无码精品亚洲日韩蜜臀浪潮|