C# 元素组合算法

class Program
    {
        static void Main(string[] args)
        {
            string[] a = { "A", "B", "C", "D" };
            for (int i = 0; i < a.Length; i++)
            {
                for (int j = i; j < a.Length; j++)
                {
                    Console.Write(a[i] + a[j] + " ");
                }
                Console.WriteLine();
            }
            Console.ReadLine();
        }
    }
原文地址:https://www.cnblogs.com/25miao/p/6409064.html