问题:若一个口袋中放有12个球,3红3白和6黑,问从袋中随意取8个球,有多少种不同的颜色搭配?

using System;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("共同拥有下面几种取法:"+'\n'+"<-------------------------------------------------------->");
            int n = 0;
            for (int i = 0; i <= 3; i++)
                for (int j = 0; j <= 3; j++)
                    if ((8 - i - j <= 6))
                        Console.WriteLine("Way{0}.红:{1}个    白:{2}个    黑:{3}个",string.Format("{0,-2}",++n),i,j,8-i-j);
            Console.ReadLine();
        }
    }
}


相关文章:

  • 2022-12-23
  • 2021-11-22
  • 2022-01-07
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-12
  • 2021-11-14
猜你喜欢
  • 2021-11-14
  • 2022-02-27
  • 2022-12-23
  • 2021-11-20
  • 2022-12-23
  • 2021-11-26
  • 2022-03-06
相关资源
相似解决方案