当前位置:编程学习 > C#/ASP.NET >>

5个好朋友想用名字的缩写组成一个单词。所以需要排列出所有的可能,怎么排列

 string[] a = {"c","m","j"};
            string[] b = {"z","j"};
            string[] c = {"c","c","s"};
            string[] d = {"z","w","j"};
            string[] e = {"z","j","h"};       
                 
              for (int one = 0; one < a.Length;one++ )
            {
                for (int two = 0; two < b.Length; two++)
                {
                    for (int three = 0; three < c.Length; three++)
                    {
                        for (int four = 0; four < d.Length; four++)
                        {
                            for (int five = 0; five < e.Length; five++)
                            {
                                 Console.Write(a[one] + b[two] + c[three] + d[four] + e[five]);
                                 Console.Write(",");
                            }
                        }
                    }
                }
               
            }




然后我就写不来了,怎么让里面的a[one]  b[two]  c[three]  d[four]  e[five]循环换个位置?求大神指教 --------------------编程问答-------------------- http://bbs.csdn.net/topics/390572575?page=1#post-395434394
补充:.NET技术 ,  C#
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,